Skip to content

Commit c933e49

Browse files
author
Joan Fontanals
authored
fix: enrich logs (#6206)
1 parent 449e087 commit c933e49

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

jina/clients/base/helper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ async def send_message(self, url, request: 'Request'):
180180
handle_response_status(r_status, r_str, url)
181181
return r_status, r_str
182182
except (ValueError, ConnectionError, BadClient, aiohttp.ClientError, aiohttp.ClientConnectionError) as err:
183-
self.logger.debug(f'Got an error: {err} sending POST to {url} in attempt {attempt}/{self.max_attempts}')
183+
self.logger.debug(f'Got an error of type {type(err)}: {err} sending POST to {url} in attempt {attempt}/{self.max_attempts}')
184184
await retry.wait_or_raise_err(
185185
attempt=attempt,
186186
err=err,
@@ -191,7 +191,7 @@ async def send_message(self, url, request: 'Request'):
191191
)
192192
except Exception as exc:
193193
self.logger.debug(
194-
f'Got a non-retried error: {exc} sending POST to {url}')
194+
f'Got a non-retried error of type {type(exc)}: {exc} sending POST to {url}')
195195
raise exc
196196

197197
async def send_streaming_message(self, url, doc: 'Document', on: str):

jina/serve/stream/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ async def stream(
220220
except (
221221
Exception
222222
) as err: # HTTP and WS need different treatment further up the stack
223-
self.logger.error(f'Error while getting responses from deployments: {err}')
223+
self.logger.error(f'Error while getting responses from deployments {type(err)}: {err}')
224224
raise err
225225

226226
async def _stream_requests(

0 commit comments

Comments
 (0)