From ecb27f33f73c4cd197f6284bd4e5c9f21592ae3d Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Mon, 23 Dec 2019 11:54:56 +0100 Subject: [PATCH] Lower log severity on error during disconnect --- telethon/network/connection/connection.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/telethon/network/connection/connection.py b/telethon/network/connection/connection.py index bd1fde8a..d7190c73 100644 --- a/telethon/network/connection/connection.py +++ b/telethon/network/connection/connection.py @@ -123,9 +123,11 @@ class Connection(abc.ABC): try: await self._writer.wait_closed() except Exception as e: - # Seen OSError: No route to host and [Errno 32] Broken pipe - # Disconnecting should never raise - self._log.warning('Unhandled %s on disconnect: %s', type(e), e) + # Disconnecting should never raise. Seen: + # * OSError: No route to host and + # * OSError: [Errno 32] Broken pipe + # * ConnectionResetError + self._log.info('%s during disconnect: %s', type(e), e) def send(self, data): """