cpr icon indicating copy to clipboard operation
cpr copied to clipboard

HTTP bad response exceptions

Open sixdenip opened this issue 5 years ago • 3 comments

Is your feature request related to a problem? Please describe. When having to process a response of a request, it can be painful and repetitive to do a switch-case on all the possible code returned by a given API just to throw exceptions.

Describe the solution you'd like Having the equivalent of Python's Requests raise_for_status() as class method of response with an Exception class, could be a solution that also follows this library philosophy.

Cheers and thanks for your work.

sixdenip avatar Sep 20 '21 09:09 sixdenip

Good idea. Any chance, you would like to create a PR for it?

COM8 avatar Sep 20 '21 10:09 COM8

Submitted PR #641

sixdenip avatar Sep 20 '21 12:09 sixdenip

Closing this one since no response and missing interest in this feature.

COM8 avatar Mar 20 '22 10:03 COM8