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

Make invoking "response.raise_for_status()" optional #36

Open
amotl opened this issue Nov 1, 2019 · 0 comments
Open

Make invoking "response.raise_for_status()" optional #36

amotl opened this issue Nov 1, 2019 · 0 comments

Comments

@amotl
Copy link
Member

amotl commented Nov 1, 2019

Hi there,

coming here from #35 (comment), @gsong was so kind to offer he would think about an option on how to toggle the behavior of one of the core methods within this library.

We are talking about the _make_request method here, which invokes response.raise_for_status() in order to raise exceptions on all HTTP requests to the OPS API which respond with HTTP status >= 400.

For reasons I am currently not able to remember exactly, we wanted to turn that behavior off within PatZilla.

Most probably it was because the exception bubbling up from this method lacked important information from the original request object we wanted to present to the user, like details from OAuth failures or rate limiting errors we are extracting from HTTP response headers or similar things.

Please advise if we are getting this wrong and the same things could be achieved with this call in place. Thanks!

With kind regards,
Andreas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants