-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Customising raise_for_status #3864
Comments
The feature request sounds reasonable. Should The real question is: want we add yet another callback into our API? Don't get me wrong: I'm not strongly against the proposal but want to discuss it carefully first. |
I understand. Technically this is not another callback, just overwriting |
|
* implement response check, #3864 * switch to raise_for_status coroutine * fix linting * revert name corrections * fix types, add request tests * change and docs * allow non callable truey raise_for_status
Fixed by #3892 |
* implement response check, aio-libs#3864 * switch to raise_for_status coroutine * fix linting * revert name corrections * fix types, add request tests * change and docs * allow non callable truey raise_for_status
* implement response check, aio-libs#3864 * switch to raise_for_status coroutine * fix linting * revert name corrections * fix types, add request tests * change and docs * allow non callable truey raise_for_status
* implement response check, aio-libs#3864 * switch to raise_for_status coroutine * fix linting * revert name corrections * fix types, add request tests * change and docs * allow non callable truey raise_for_status (cherry picked from commit e5beaca)
…892 implement response check (#6731) * implement response check (#3892) * implement response check, #3864 * switch to raise_for_status coroutine * fix linting * revert name corrections * fix types, add request tests * change and docs * allow non callable truey raise_for_status (cherry picked from commit e5beaca) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * remove noqa Co-authored-by: Samuel Colvin <s@muelcolvin.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
It would be great if it was possible to customize
raise_for_status
to:extra_info
) to sentry etc.200
Adding all this to aiohttp would obviously be infeasible, but it would be possible to add another kwarg when creating a client session
response_check
- a coroutine called whenraise_for_status=True
to check if a response is valid.This approach would be backwards compatible.
It would also be useful if
check_response
were also called for request timeouts, but maybe that's more complicated and would not be backwards compatible.Information which might be useful when debugging http client requests:
I don't want to add all these to the standard error, but allowing a coroutine to check responses would allow all this to added if I wanted.
The text was updated successfully, but these errors were encountered: