Reading response after raising errors in hooks #2364
Unanswered
Bobronium
asked this question in
Potential Issue
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Previous discussion
#2224
Problem
Currently response hooks are executed before response has been read. If any exception is raised during that time, https will call
response.close(), preventing further read.This doesn't play well with this pattern:
Workarounds
Client.sendto raise for status after super().send has returned responseSolutions
Beta Was this translation helpful? Give feedback.
All reactions