fix(http_handler.py): add retry logic for httpx.ConnectError

This commit is contained in:
Krrish Dholakia 2024-06-28 22:35:26 -07:00
parent 831745e710
commit 8571cb45e8

View file

@ -98,7 +98,7 @@ class AsyncHTTPHandler:
response = await self.client.send(req, stream=stream)
response.raise_for_status()
return response
except httpx.RemoteProtocolError:
except (httpx.RemoteProtocolError, httpx.ConnectError):
# Retry the request with a new session if there is a connection error
new_client = self.create_client(timeout=self.timeout, concurrent_limit=1)
try: