Can we include the error message in raise_for_status()
?
#3669
Unanswered
georgy95
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.
-
Often, I send an http request, and there is an API error that informs me of the error. The specific error message, however isn't passed / propagated back.
raise_for_status()
essentially consumes the error and returns a more "generic" status-code error.For example, when processing an oauth2 callback, a httpx request might result in a specific error e.g. "Code already used", but
raise_for_status()
will not pass down the specific message.I propose to add an error message in the message in the response e.g.
Source: https://github.com/encode/httpx/blob/master/httpx/_models.py#L794
Beta Was this translation helpful? Give feedback.
All reactions