-
-
Notifications
You must be signed in to change notification settings - Fork 273
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
Add more details to exceptions #467
Comments
Reasonable request. However, I'm afraid that status code might be unavailable when a "real" exception happens, i.e. when something went wrong during requesting. |
And if include the fields with errors that consistently have a status, such as HTTPError? curl_cffi/curl_cffi/requests/models.py Line 146 in 15500fa
And then I can check if the exception is a HTTPError type |
Oh, yeah. I think we can guarantee that HTTPError does have a status code itself or in response. |
Also noticed that the error thrown by |
I see, I guess it's more consistent to add the response field to the exception. |
Hi,
I'm trying to find a clean way to handle errors in my project, but I’ve noticed that exceptions, specifically RequestException, do not return an integer that can be used to handle errors programmatically.
It would be incredibly useful if all the fields in RequestException were filled, including an integer field (e.g., an error code) that provides more clarity for error handling.
Right now:
I expect (with status_code):
OR (with curl error code)
e.response.status_code
:Describe the solution you'd like
To be able to easly identify the status error code
Describe alternatives you've considered
I tried to get it from the error message, but it is a bit of hack.
Thank you.
The text was updated successfully, but these errors were encountered: