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
Properly parse errorMessage key in error response #1526
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for catching this.
Could you add some tests for this? The tests/test_resilientsession.py
would be the best place
jira/resources.py
Outdated
raise_on_error(r) | ||
error_list = parse_errors(r) | ||
logging.error(error_list) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would we want to log the error and afterwards raise?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it looks like raising the error should be removed completely as it will always raise for 400 HTTP response
previously it was raised in the json_loads
and caught by get_error_list
code
I've fixed the issue with unexpected error raising and added a test for errors parsing logic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent stuff
Thanks for the great quality PR ! |
After recent refactoring of the resilientsession module, we started to get empty text field in the JIRAError instances for the "Site temporary unavailable" errors.
This PR adds proper processing of such error responses and also adds consistency in errors processing in several parts of the lib