update ws error handle

This commit is contained in:
anovazzi1 2023-05-05 12:43:39 -03:00
commit a99a434c12

View file

@ -175,8 +175,10 @@ class ChatManager:
# Handle any exceptions that might occur
logger.exception(e)
# send a message to the client
await self.send_message(client_id, str(e))
raise e
await self.active_connections[client_id].close(
code=1011, reason=str(e)
)
finally:
await self.active_connections[client_id].close(
code=1000, reason="Client disconnected"