diff --git a/litellm/llms/custom_httpx/http_handler.py b/litellm/llms/custom_httpx/http_handler.py index 3dfef07d426..859ea6d2b4d 100644 --- a/litellm/llms/custom_httpx/http_handler.py +++ b/litellm/llms/custom_httpx/http_handler.py @@ -466,7 +466,8 @@ class AsyncHTTPHandler: response = await self.client.send(req, stream=stream) response.raise_for_status() return response - except (httpx.RemoteProtocolError, httpx.ConnectError): + except (httpx.RemoteProtocolError, httpx.ConnectError) as e: + verbose_logger.warning(f"ConnectError on POST {url}: {e}") # Retry the request with a new session if there is a connection error new_client = self.create_client( timeout=timeout, event_hooks=self.event_hooks @@ -538,7 +539,8 @@ class AsyncHTTPHandler: response = await self.client.send(req) response.raise_for_status() return response - except (httpx.RemoteProtocolError, httpx.ConnectError): + except (httpx.RemoteProtocolError, httpx.ConnectError) as e: + verbose_logger.warning(f"ConnectError on PUT {url}: {e}") # Retry the request with a new session if there is a connection error new_client = self.create_client( timeout=timeout, event_hooks=self.event_hooks