From 9a69a71ea1ff9561743afc3c3e57e1e39eb0d946 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Thu, 29 Jun 2023 22:07:23 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(chat.py):=20add=20exception?= =?UTF-8?q?=20logging=20to=20stream=5Fbuild=20function=20to=20improve=20er?= =?UTF-8?q?ror=20handling=20The=20`stream=5Fbuild`=20function=20now=20logs?= =?UTF-8?q?=20the=20exception=20that=20occurred=20during=20the=20flow=20bu?= =?UTF-8?q?ilding=20process=20using=20the=20`logger.exception`=20method.?= =?UTF-8?q?=20This=20improves=20error=20handling=20and=20provides=20more?= =?UTF-8?q?=20detailed=20information=20about=20the=20error=20in=20the=20lo?= =?UTF-8?q?gs.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backend/langflow/api/v1/chat.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/backend/langflow/api/v1/chat.py b/src/backend/langflow/api/v1/chat.py index cdffcdf4f..b394afc99 100644 --- a/src/backend/langflow/api/v1/chat.py +++ b/src/backend/langflow/api/v1/chat.py @@ -139,6 +139,7 @@ async def stream_build(flow_id: str): # We need to reset the chat history chat_manager.chat_history.empty_history(flow_id) except Exception as exc: + logger.exception(exc) logger.error("Error while building the flow: %s", exc) yield str(StreamData(event="error", data={"error": str(exc)})) finally: