-
Notifications
You must be signed in to change notification settings - Fork 4
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
fix(response): reoder exception handling to correctly parse a broken response #164
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.
I left two minor suggestions.
In general, it would be nice to do only one thing in the try-block.
Then it is easier to parse the exceptions. What can go wrong where.
You suggest placing line 341 https://github.com/GIScience/ohsome-py/pull/164/files#diff-0684a040fd4741e6267194be04e688f118c72fdae4256902f407e9a6c11dac2aL341 into a separate try block? |
Yes, or even: response = self._session().post(url=self._url, data=self._parameters)
try:
response.raise_for_status(
except:
...
try:
response.json()
except:
... So that one knows that exceptions caught in one block belong only to the http response or json parsing and not to |
Co-authored-by: Matthias (~talfus-laddus) <[email protected]>
Co-authored-by: Matthias (~talfus-laddus) <[email protected]>
…166) Bumps the pip group with 1 update: [notebook](https://github.com/jupyter/notebook). Updates `notebook` from 7.2.1 to 7.2.2 - [Release notes](https://github.com/jupyter/notebook/releases) - [Changelog](https://github.com/jupyter/notebook/blob/@jupyter-notebook/[email protected]/CHANGELOG.md) - [Commits](https://github.com/jupyter/notebook/compare/@jupyter-notebook/[email protected]...@jupyter-notebook/[email protected]) --- updated-dependencies: - dependency-name: notebook dependency-type: indirect dependency-group: pip ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
8da315d
to
486de18
Compare
…ct is a major breaking change)
thanks, I had the same gut feeling during coding but thought it was too complicated. I have made this change now, please re-review |
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.
Looks good, as far as I can see. Thanks!
No description provided.