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
Document which exceptions request() might raise #6653
Comments
As a newcomer to this project, I'm eager to contribute and address the mentioned issue. I'd like to inquire about the exceptions list mentioned in the documentation—is it exhaustive and does it encompass all possible exceptions? If so, I'm prepared to work on enhancing the documentation. My proposal is to not only update the main interface but also extend the coverage to other methods, aiming for consistency similar to what is currently done for the .json() function. |
That would lead to a lot of code duplication in my opinion, apart from |
Ask to document which exceptions request() might raise
I notice that the .json function documents that it might raise a
JSONDecodeError
. This is very helpful for writing comprehensive error handling code around requests. I'm asking for that to be done for the main interface as well.While a list of exceptions is provided in the documentation, it is not clear which exceptions will be returned by which methods. For example I don't think
JSONDecodeError
can be raised by.get
. I tried to read the requests code to get a sense of which might be thrown from it, but it is a little challenging to follow as a first time reader.The text was updated successfully, but these errors were encountered: