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