Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http errors and responseError #141

Closed
shendaras opened this issue Jan 17, 2018 · 1 comment
Closed

http errors and responseError #141

shendaras opened this issue Jan 17, 2018 · 1 comment

Comments

@shendaras
Copy link

Currently, in responseError the http.Response body is decoded into a jiradata.ErrorCollection{}. For some errors, like 401 Unauthorized, this results in a JSON parse failure because the response body is not a JSON object.

The error that is returned contains the parse failure but there's no way to determine the StatusCode or Status of the response. I can guess at the failure by checking to see if the error returned is a jiradata.ErrorCollection and assuming the error is a non-200 response, but it would be nice to have a way to check more explicitly for the Status.

@coryb
Copy link
Contributor

coryb commented Feb 12, 2018

Hey, I just committed a change that should address this issue. We now set the Status always and append to ErrorMessages if there is a json parse error.

@coryb coryb closed this as completed Feb 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants