handle timeout error

This commit is contained in:
əlemi 2021-11-24 03:23:30 +01:00
parent 06d03266c9
commit 3451cefd5c

View file

@ -221,6 +221,9 @@ class Dispatcher:
await self._incoming.join() # During play we can pre-process packets await self._incoming.join() # During play we can pre-process packets
except AttributeError: except AttributeError:
self._logger.debug("Received unimplemented packet [%d] %s", packet_id, cls.__name__) # TODO this is cheating! implement them! self._logger.debug("Received unimplemented packet [%d] %s", packet_id, cls.__name__) # TODO this is cheating! implement them!
except TimeoutError:
self._logger.error("Connection timed out")
await self.disconnect(block=False)
except ConnectionResetError: except ConnectionResetError:
self._logger.error("Connection reset while reading packet") self._logger.error("Connection reset while reading packet")
await self.disconnect(block=False) await self.disconnect(block=False)