- Notifications
You must be signed in to change notification settings - Fork 123
Open
Open
Copy link
Milestone
Description
The current implementation of ClientInterface has several issues:
- not all error HTTP codes are converted to an exception (e.g. HTTP 401 code is, but others are not)
- the API response is lost when exception is thrown
- cURL transport errors (for
CurlClientonly) aren't handled at all
Proposing to:
- throw an exception on any non-2xx HTTP response code
- for the
\chobie\Jira\Api\Exceptionclass:- add the protected
rawResponseproperty, which will be populated from the constructor - add public
getRawReponsemethod, that will return the above property - add public
getResponsemethod, that will return a json-decoded version of the raw response
- add the protected
This way a developer will be informed about the error (through an exception being thrown) and can do further error analysis using the getResponse method.
Also TODO:
Remove code, that is handling errors from the \chobie\Jira\Api::findVersionByName method.
Metadata
Metadata
Assignees
Labels
No labels