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

Attach Request and Response to HttpProcessingError raised from client #1705

Closed
justanr opened this issue Mar 9, 2017 · 6 comments
Closed
Labels

Comments

@justanr
Copy link

justanr commented Mar 9, 2017

With request's Response.raise_for_status, the raised exception has the request and responses that caused that status attached to it. This allows handling of error codes + content to be off loaded from the calling code (into a decorator etc).

If there's interest, I'm happy to put together a PR.

@fafhrd91
Copy link
Member

could you provide PR in this repo https://github.com/aio-libs/aiohttp

@justanr
Copy link
Author

justanr commented Mar 13, 2017

Yeah, is that the new canonical repo?

@fafhrd91
Copy link
Member

I dont really want to document ClientRequest class, too much specific low level details. otherwise any PRs are welcome

@penguinolog
Copy link
Contributor

Response to HttpProcessingError - i agree this idea. if @fafhrd91 @asvetlov will accept - pull request will be made at short time.
Currently, on our deploy, we to use our own raise_for_status with this functionality.

@fafhrd91
Copy link
Member

ClientResponseError now has request_info attribute

@lock
Copy link

lock bot commented Oct 28, 2019

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.

@lock lock bot added the outdated label Oct 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants