From: Johannes Date: Fri, 1 Apr 2022 15:06:24 +0000 (+0100) Subject: Fix raise_for_status exception docs (#2159) X-Git-Tag: 0.23.0~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=781076cb63baa61e269eab18df861fdc901e4e59;p=thirdparty%2Fhttpx.git Fix raise_for_status exception docs (#2159) Closes #2126 --- 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