httpx.ConnectError: Failed to connect to the server.
httpx.ReadTimeout: Timeout while waiting for a response.
httpx.WriteTimeout: Timeout while sending a request.
httpx.ConnectTimeout: Timeout while establishing a connection.
Server Errors (5xx status codes)
These indicate issues on the server side, which could be transient.
httpx.HTTPStatusError: Raised when an invalid HTTP response status is encountered. You may want to retry if the status code is in the 500–599 range (server errors like 500, 502, 503, 504).
DNS Resolution Errors
httpx.ProxyError: Failure to connect via a proxy server.
httpx.NetworkError: General network-related error, could indicate a temporary issue with DNS resolution or routing.
Retry now only happens on ProtocolError, i.g. when remote end drops connection. It makes sense to retry in other scenarios, including 5xx error codes.
Connection Errors (e.g., temporary network issues)
httpx.ConnectError
: Failed to connect to the server.httpx.ReadTimeout
: Timeout while waiting for a response.httpx.WriteTimeout
: Timeout while sending a request.httpx.ConnectTimeout
: Timeout while establishing a connection.Server Errors (5xx status codes)
These indicate issues on the server side, which could be transient.
httpx.HTTPStatusError
: Raised when an invalid HTTP response status is encountered. You may want to retry if the status code is in the 500–599 range (server errors like 500, 502, 503, 504).DNS Resolution Errors
httpx.ProxyError
: Failure to connect via a proxy server.httpx.NetworkError
: General network-related error, could indicate a temporary issue with DNS resolution or routing.