From c933e4998a2d8bafe80851f00f3ef94cd63a5e29 Mon Sep 17 00:00:00 2001 From: Joan Fontanals Date: Thu, 26 Sep 2024 17:12:46 +0200 Subject: [PATCH] fix: enrich logs (#6206) --- jina/clients/base/helper.py | 4 ++-- jina/serve/stream/__init__.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/jina/clients/base/helper.py b/jina/clients/base/helper.py index 50f43ae69e264..6c4a2fd611e21 100644 --- a/jina/clients/base/helper.py +++ b/jina/clients/base/helper.py @@ -180,7 +180,7 @@ async def send_message(self, url, request: 'Request'): handle_response_status(r_status, r_str, url) return r_status, r_str except (ValueError, ConnectionError, BadClient, aiohttp.ClientError, aiohttp.ClientConnectionError) as err: - self.logger.debug(f'Got an error: {err} sending POST to {url} in attempt {attempt}/{self.max_attempts}') + self.logger.debug(f'Got an error of type {type(err)}: {err} sending POST to {url} in attempt {attempt}/{self.max_attempts}') await retry.wait_or_raise_err( attempt=attempt, err=err, @@ -191,7 +191,7 @@ async def send_message(self, url, request: 'Request'): ) except Exception as exc: self.logger.debug( - f'Got a non-retried error: {exc} sending POST to {url}') + f'Got a non-retried error of type {type(exc)}: {exc} sending POST to {url}') raise exc async def send_streaming_message(self, url, doc: 'Document', on: str): diff --git a/jina/serve/stream/__init__.py b/jina/serve/stream/__init__.py index 03c488d78f114..995c47818e491 100644 --- a/jina/serve/stream/__init__.py +++ b/jina/serve/stream/__init__.py @@ -220,7 +220,7 @@ async def stream( except ( Exception ) as err: # HTTP and WS need different treatment further up the stack - self.logger.error(f'Error while getting responses from deployments: {err}') + self.logger.error(f'Error while getting responses from deployments {type(err)}: {err}') raise err async def _stream_requests(