Document which exceptions request() might raise
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 54.3k
- Forks
- 10.5k
- Avg merge
- 16h 43m
- Merged PRs (30d)
- 3
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the main interface documentation for request() and the linked exceptions reference, then inspect the request() entry point to identify exceptions associated with each documented method. Done means the API documentation clearly states which exceptions each main-interface method may raise, with behavior consistent with the existing Response.json() documentation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100