fix(chat_manager.py): limit the length of the exception message to 120 characters

This commit is contained in:
Gabriel Almeida 2023-05-11 10:18:07 -03:00
commit b16084d927

View file

@ -177,7 +177,7 @@ class ChatManager:
logger.exception(e) logger.exception(e)
# send a message to the client # send a message to the client
await self.active_connections[client_id].close( await self.active_connections[client_id].close(
code=status.WS_1011_INTERNAL_ERROR, reason=str(e) code=status.WS_1011_INTERNAL_ERROR, reason=str(e)[:120]
) )
self.disconnect(client_id) self.disconnect(client_id)
finally: finally: