From 8eba7722d21972adca500315fd5dda2429e11eef Mon Sep 17 00:00:00 2001 From: Johannes Date: Fri, 1 Apr 2022 15:47:33 +0100 Subject: [PATCH] Fix raise_for_status exception docs Closes #2126 --- docs/exceptions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/exceptions.md b/docs/exceptions.md index 71c8a17e02..d96e23ab0d 100644 --- a/docs/exceptions.md +++ b/docs/exceptions.md @@ -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