update ws error handle
This commit is contained in:
parent
8758dd85d5
commit
a99a434c12
1 changed files with 4 additions and 2 deletions
|
|
@ -175,8 +175,10 @@ class ChatManager:
|
||||||
# Handle any exceptions that might occur
|
# Handle any exceptions that might occur
|
||||||
logger.exception(e)
|
logger.exception(e)
|
||||||
# send a message to the client
|
# send a message to the client
|
||||||
await self.send_message(client_id, str(e))
|
await self.active_connections[client_id].close(
|
||||||
raise e
|
code=1011, reason=str(e)
|
||||||
|
)
|
||||||
|
|
||||||
finally:
|
finally:
|
||||||
await self.active_connections[client_id].close(
|
await self.active_connections[client_id].close(
|
||||||
code=1000, reason="Client disconnected"
|
code=1000, reason="Client disconnected"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue