Fix raise_for_status exception docs (#2159)

Closes #2126
This commit is contained in:
Johannes 2022-04-01 16:06:24 +01:00 committed by GitHub
parent 550fff933f
commit 781076cb63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,7 +14,7 @@ except httpx.RequestError as exc:
print(f"An error occurred while requesting {exc.request.url!r}.")
```
The `HTTPStatusError` class is raised by `response.raise_for_status()` on 4xx and 5xx responses.
The `HTTPStatusError` class is raised by `response.raise_for_status()` on responses which are not a 2xx success code.
These exceptions include both a `.request` and a `.response` attribute.
```python