From 69e5bb3c29d4251226635b07d2e2437a86005ef6 Mon Sep 17 00:00:00 2001 From: urec56 Date: Tue, 20 Aug 2024 14:54:31 +0400 Subject: [PATCH] =?UTF-8?q?=D0=91=D0=B0=D0=B3=D1=84=D0=B8=D0=BA=D1=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/chat/websocket.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/chat/websocket.py b/app/chat/websocket.py index d82378a..a216121 100644 --- a/app/chat/websocket.py +++ b/app/chat/websocket.py @@ -1,4 +1,5 @@ import asyncio +import logging from collections import defaultdict import websockets @@ -138,7 +139,8 @@ async def websocket_endpoint( reason = e.detail code_and_reason = (code, reason) await manager.disconnect(chat_id=chat_id, websocket=websocket, code_and_reason=code_and_reason) - except Exception: + except Exception as e: + logging.warning(e) code_and_reason = (status.WS_1011_INTERNAL_ERROR, "Internal Server Error") await manager.disconnect(chat_id=chat_id, websocket=websocket, code_and_reason=code_and_reason)