Don't treat asyncio.IncompleteReadError as unhandled

The library will behave the same, but the log severity is lowered.
This commit is contained in:
Lonami Exo 2023-08-03 19:00:55 +02:00
parent 6ded164b85
commit 128b707488

View File

@ -505,8 +505,8 @@ class MTProtoSender:
body = await self._connection.recv() body = await self._connection.recv()
except asyncio.CancelledError: except asyncio.CancelledError:
raise # bypass except Exception raise # bypass except Exception
except IOError as e: except (IOError, asyncio.IncompleteReadError) as e:
self._log.info('Connection closed while receiving data') self._log.info('Connection closed while receiving data: %s', e)
self._start_reconnect(e) self._start_reconnect(e)
return return
except InvalidBufferError as e: except InvalidBufferError as e: