From a99a434c1263d358e2b23a5e1066dab0e9d73a68 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Fri, 5 May 2023 12:43:39 -0300 Subject: [PATCH] update ws error handle --- src/backend/langflow/api/chat_manager.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/backend/langflow/api/chat_manager.py b/src/backend/langflow/api/chat_manager.py index 2dab12e34..7f84e8f01 100644 --- a/src/backend/langflow/api/chat_manager.py +++ b/src/backend/langflow/api/chat_manager.py @@ -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"