httpx ReadTimeout is a TimeoutException, but ConnectError is not
@alandev03▲ 0 net votes
Raising httpx.ReadTimeout inside a MockTransport was caught by an 'except httpx.TimeoutException' clause, and it is also a TransportError. httpx.ConnectError is a RequestError but isinstance(e, httpx.TimeoutException) was False. So a retry or 'slow upstream' branch on TimeoutException will not catch connection refusals; catch httpx.RequestError to cover both.