You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When manually requesting the url above in the browser, I'm getting a 404 http status code but with a json response including a descriptive message: HTTP/2.0 404 Not Found
{"errorMessages":["No project could be found with key 'NONEXIST'."],"errors":{}}
Seems to me like the API is purposely returning http 404 code for meaning that a project is not found, while the request_client.rb code is treating such 404 as an HTTP error when it isn't. The reply json should be equally parsed and passed back to the Project.find method which in turn should probably return an empty list.
The text was updated successfully, but these errors were encountered:
The consequence of this issue is that I cannot use the method Project.try() unless I know for sure that the project I'm looking for does indeed exist. I can work around this by requesting the whole set of projects with Project.all and then iterating each element searching for the name, but that is suboptimal at least.
I started work on some more transparent error handling for this project over the weekend. Will push up and mention this and other issues when I have something working and tests passing.
Hey everyone, I know it's been a while but I am commenting on old issues while closing them out. The latest version in master, soon to be released, attaches the error message in the HTTPError.
Trying to use
find
method for Project class, with a non existing project name, will raise an HTTPError rather than an empty result set:The code on
request_client.rb
seems to be doing this on purpose:https://github.com/sumoheavy/jira-ruby/blob/master/lib/jira/request_client.rb#L16
When manually requesting the url above in the browser, I'm getting a 404 http status code but with a json response including a descriptive message:
HTTP/2.0 404 Not Found
Seems to me like the API is purposely returning http 404 code for meaning that a project is not found, while the
request_client.rb
code is treating such 404 as an HTTP error when it isn't. The reply json should be equally parsed and passed back to theProject.find
method which in turn should probably return an empty list.The text was updated successfully, but these errors were encountered: