We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
aiohttp should provide a helper's method to check for errors in responses. Something like request's raise_for_error.
raise_for_error
The text was updated successfully, but these errors were encountered:
Something like:
ClientResponse: … def raise_for_status(self): http_error_msg = '' if 400 <= self.status< 500: http_error_msg = 'Client Error: {}'.format(self.reason) elif 500 <= self.status < 600: http_error_msg = 'Server Error: {}'.format(self.reason) if http_error_msg: raise aiohttp.HttpProcessingError(code=self.status, message=http_error_msg)
(borrowed from requests)
Sorry, something went wrong.
Good to have. Not sure about exact exception type though.
Add client_resp.raise_for_status()
9b5a975
This method raises an exception for statuses that represent an error. Closes aio-libs#868.
41a17d0
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
If you feel like there's important points made in this discussion, please include those exceprts into that new issue.
No branches or pull requests
Long story short
aiohttp should provide a helper's method to check for errors in responses. Something like request's
raise_for_error
.The text was updated successfully, but these errors were encountered: