From: Gerhard van Andel Date: Sun, 20 Dec 2020 19:43:33 +0000 (+0000) Subject: Update exceptions.md (#1432) X-Git-Tag: 0.17.0~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3c89b91d6b912825dacf54113df4f1926dc3ca42;p=thirdparty%2Fhttpx.git Update exceptions.md (#1432) --- diff --git a/docs/exceptions.md b/docs/exceptions.md index 1bc86100..949ac47a 100644 --- a/docs/exceptions.md +++ b/docs/exceptions.md @@ -11,7 +11,7 @@ while issuing an HTTP request. These exceptions include a `.request` attribute. try: response = httpx.get("https://www.example.com/") except httpx.RequestError as exc: - print(f"An error occured while requesting {exc.request.url!r}.") + 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. @@ -45,7 +45,7 @@ try: response = httpx.get("https://www.example.com/") response.raise_for_status() except httpx.RequestError as exc: - print(f"An error occured while requesting {exc.request.url!r}.") + print(f"An error occurred while requesting {exc.request.url!r}.") except httpx.HTTPStatusError as exc: print(f"Error response {exc.response.status_code} while requesting {exc.request.url!r}.") ```