Closed aaronmurniadi closed 2 years ago
This issue is Stale because it has been open for 90 days with no activity. Contribute a fix or comment on the issue, or it will be closed in a few days.
This issue has been marked as Stale and closed due to inactivity.
Hi everyone, thank you for this amazing project.
As the title describes, I am looking for Requests' response.raise_for_status() equivalent in
faster_than_requests
tl;dr: It raises :class:
HTTPError
, if one occurred (for both client and server side errors), and returns appropriate description of it.Thanks!
PS: My current solution is to assert the
response[2]
value:But this is tedious to do for each possible error messages.
I can not use
if 400 <= self.status_code < 500:
andelif 500 <= self.status_code < 600:
logic like whatRequests
did (see link above) becauseresponse[2]
returns a string like500 Internal Server Error
.Any help is very much appreciated!