]> git.ipfire.org Git - thirdparty/httpx.git/commitdiff
Update compatibility.md with documentation of exceptions differences (#3649)
authorGlen Keane <glenkeane.94@gmail.com>
Fri, 5 Sep 2025 14:19:37 +0000 (15:19 +0100)
committerGitHub <noreply@github.com>
Fri, 5 Sep 2025 14:19:37 +0000 (15:19 +0100)
Co-authored-by: Kim Christie <tom@tomchristie.com>
docs/compatibility.md

index 52e9389a79e00a44e8392d4847b5da152046eebf..9686167574a73033888e528fe1f012475841b5d1 100644 (file)
@@ -226,3 +226,7 @@ For both query params (`params=`) and form data (`data=`), `requests` supports s
 In HTTPX, event hooks may access properties of requests and responses, but event hook callbacks cannot mutate the original request/response.
 
 If you are looking for more control, consider checking out [Custom Transports](advanced/transports.md#custom-transports).
+
+## Exceptions and Errors
+
+`requests` exception hierarchy is slightly different to the `httpx` exception hierarchy. `requests` exposes a top level `RequestException`, where as `httpx` exposes a top level `HTTPError`. see the exceptions exposes in requests [here](https://requests.readthedocs.io/en/latest/_modules/requests/exceptions/). See the `httpx` error hierarchy [here](https://www.python-httpx.org/exceptions/).