mirror of
https://github.com/solero/houdini.git
synced 2025-08-09 20:24:05 +00:00
Catch all unhandled exceptions on packet handling
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
from houdini.handlers import XMLPacket, XTPacket
|
from houdini.handlers import XMLPacket, XTPacket
|
||||||
|
|
||||||
from asyncio import IncompleteReadError
|
from asyncio import IncompleteReadError, CancelledError
|
||||||
|
|
||||||
import defusedxml.cElementTree as Et
|
import defusedxml.cElementTree as Et
|
||||||
from xml.etree.cElementTree import Element, SubElement, tostring
|
from xml.etree.cElementTree import Element, SubElement, tostring
|
||||||
@@ -153,8 +153,13 @@ class Spheniscidae:
|
|||||||
await self.__writer.drain()
|
await self.__writer.drain()
|
||||||
except IncompleteReadError:
|
except IncompleteReadError:
|
||||||
self.__writer.close()
|
self.__writer.close()
|
||||||
|
except CancelledError:
|
||||||
|
self.__writer.close()
|
||||||
except ConnectionResetError:
|
except ConnectionResetError:
|
||||||
self.__writer.close()
|
self.__writer.close()
|
||||||
|
except BaseException as e:
|
||||||
|
self.logger.exception(e.__traceback__)
|
||||||
|
|
||||||
await self._client_disconnected()
|
await self._client_disconnected()
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
|
Reference in New Issue
Block a user