mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-08 12:59:46 +00:00
Expect ConnectionError in the send loop
This commit is contained in:
@@ -136,9 +136,12 @@ class Connection(abc.ABC):
|
|||||||
await self._writer.drain()
|
await self._writer.drain()
|
||||||
except asyncio.CancelledError:
|
except asyncio.CancelledError:
|
||||||
pass
|
pass
|
||||||
except Exception:
|
except Exception as e:
|
||||||
msg = 'Unexpected exception in the send loop'
|
if isinstance(e, ConnectionError):
|
||||||
__log__.exception(msg)
|
__log__.info('The server closed the connection while sending')
|
||||||
|
else:
|
||||||
|
__log__.exception('Unexpected exception in the send loop')
|
||||||
|
|
||||||
self.disconnect()
|
self.disconnect()
|
||||||
|
|
||||||
async def _recv_loop(self):
|
async def _recv_loop(self):
|
||||||
|
Reference in New Issue
Block a user