]> git.ipfire.org Git - thirdparty/httpx.git/commitdiff
Use Mozilla documentation instead of `httpstatuses.com` for HTTP error reference...
authorZanie <contact@zanie.dev>
Thu, 13 Jul 2023 20:17:07 +0000 (15:17 -0500)
committerGitHub <noreply@github.com>
Thu, 13 Jul 2023 20:17:07 +0000 (15:17 -0500)
docs/quickstart.md
httpx/_models.py
tests/models/test_responses.py

index 07cbfd08653029f69d1d537765f6fe08982ba235..1152a14bd36ae60c7e3ba140fbbb991cbc87bd62 100644 (file)
@@ -285,7 +285,7 @@ Traceback (most recent call last):
   File "/Users/tomchristie/GitHub/encode/httpcore/httpx/models.py", line 837, in raise_for_status
     raise HTTPStatusError(message, response=self)
 httpx._exceptions.HTTPStatusError: 404 Client Error: Not Found for url: https://httpbin.org/status/404
-For more information check: https://httpstatuses.com/404
+For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/404
 ```
 
 Any successful response codes will simply return `None` rather than raising an exception.
index e0e5278cc052e2f9a6d0af0a1cb2107b03de98f4..708aa2af7e5fbb91f23a918338150075c830f4b6 100644 (file)
@@ -729,12 +729,12 @@ class Response:
             message = (
                 "{error_type} '{0.status_code} {0.reason_phrase}' for url '{0.url}'\n"
                 "Redirect location: '{0.headers[location]}'\n"
-                "For more information check: https://httpstatuses.com/{0.status_code}"
+                "For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/{0.status_code}"
             )
         else:
             message = (
                 "{error_type} '{0.status_code} {0.reason_phrase}' for url '{0.url}'\n"
-                "For more information check: https://httpstatuses.com/{0.status_code}"
+                "For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/{0.status_code}"
             )
 
         status_class = self.status_code // 100
index ba46692e0d291d42399adfb68dd6c78484d37d05..9e65de8154575d25b6bfa03a4cddc942e3969849 100644 (file)
@@ -102,7 +102,7 @@ def test_raise_for_status():
         response.raise_for_status()
     assert str(exc_info.value) == (
         "Informational response '101 Switching Protocols' for url 'https://example.org'\n"
-        "For more information check: https://httpstatuses.com/101"
+        "For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/101"
     )
 
     # 3xx status codes are redirections.
@@ -114,7 +114,7 @@ def test_raise_for_status():
     assert str(exc_info.value) == (
         "Redirect response '303 See Other' for url 'https://example.org'\n"
         "Redirect location: 'https://other.org'\n"
-        "For more information check: https://httpstatuses.com/303"
+        "For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/303"
     )
 
     # 4xx status codes are a client error.
@@ -125,7 +125,7 @@ def test_raise_for_status():
         response.raise_for_status()
     assert str(exc_info.value) == (
         "Client error '403 Forbidden' for url 'https://example.org'\n"
-        "For more information check: https://httpstatuses.com/403"
+        "For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403"
     )
 
     # 5xx status codes are a server error.
@@ -136,7 +136,7 @@ def test_raise_for_status():
         response.raise_for_status()
     assert str(exc_info.value) == (
         "Server error '500 Internal Server Error' for url 'https://example.org'\n"
-        "For more information check: https://httpstatuses.com/500"
+        "For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500"
     )
 
     # Calling .raise_for_status without setting a request instance is