Skip to content

Commit 7b93a75

Browse files
committed
Convert recv errors as warnings and not exceptions
1 parent 99fc17b commit 7b93a75

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

proxy/http/handler.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,9 +286,9 @@ async def handle_readables(self, readables: Readables) -> bool:
286286
# here to avoid flooding the logs.
287287
logger.debug('%r' % e)
288288
else:
289-
logger.exception(
290-
'Exception while receiving from %s connection %r with reason %r' %
291-
(self.work.tag, self.work.connection, e),
289+
logger.warning(
290+
'Exception when receiving from %s connection#%d with reason %r' %
291+
(self.work.tag, self.work.connection.fileno(), e),
292292
)
293293
return True
294294
return False

proxy/http/proxy/server.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -291,9 +291,9 @@ async def read_from_descriptors(self, r: Readables) -> bool:
291291
),
292292
)
293293
else:
294-
logger.exception(
295-
'Exception while receiving from %s connection %r with reason %r' %
296-
(self.upstream.tag, self.upstream.connection, e),
294+
logger.warning(
295+
'Exception while receiving from %s connection#%d with reason %r' %
296+
(self.upstream.tag, self.upstream.connection.fileno(), e),
297297
)
298298
return self._close_and_release()
299299

0 commit comments

Comments
 (0)