From 781076cb63baa61e269eab18df861fdc901e4e59 Mon Sep 17 00:00:00 2001 From: Johannes Date: Fri, 1 Apr 2022 16:06:24 +0100 Subject: [PATCH] Fix raise_for_status exception docs (#2159) Closes #2126 --- docs/exceptions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/exceptions.md b/docs/exceptions.md index 71c8a17e..d96e23ab 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