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.
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
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.
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.
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.
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