Handle CancelledError inside mtprotosender recv loop

This commit is contained in:
Lonami Exo 2023-06-02 19:04:39 +02:00
parent c3ec775607
commit 4ff7ac6b75

View File

@ -503,6 +503,8 @@ class MTProtoSender:
self._log.debug('Receiving items from the network...')
try:
body = await self._connection.recv()
except asyncio.CancelledError:
raise # bypass except Exception
except IOError as e:
self._log.info('Connection closed while receiving data')
self._start_reconnect(e)