-
Notifications
You must be signed in to change notification settings - Fork 38
Exception enhancements #90
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
Conversation
…gorithm_HTTP response failure handling (for 5xx errors).
…gorithm_HTTP response failure handling (for 5xx errors).
| def create_algo_response(responseJson): | ||
| # Parse response JSON | ||
| if 'error' in responseJson: | ||
| def create_algo_response(response): |
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.
This has been renamed, because the response might not be json
| response = self.requestSession.post(self.apiAddress + url, data=input_json, headers=headers, params=query_parameters) | ||
|
|
||
| if parse_response_as_json: | ||
| if parse_response_as_json and response.status_code == 200: |
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.
checks to ensure that the response is 200; which our API servers always set, but if there's a failure along the path we might not be able to deserialize as json
kennydaniel
left a comment
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.
That looks much better 👍
Migrated logic from #84
ran into some complications in a previous PR; but changelog looks pretty clean now, unsure how to fix whitespace issue easily but testing is completely functional.