From 6c17949d21f1e0c9f28925c2b97cd4a6f13a32e4 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Sat, 8 Jul 2023 11:43:01 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20fix(base.py):=20add=20exception?= =?UTF-8?q?=20handling=20when=20formatting=20intermediate=20steps=20to=20p?= =?UTF-8?q?revent=20crashes=20and=20log=20the=20exception?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backend/langflow/processing/base.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/backend/langflow/processing/base.py b/src/backend/langflow/processing/base.py index 478b98816..e8880c34e 100644 --- a/src/backend/langflow/processing/base.py +++ b/src/backend/langflow/processing/base.py @@ -39,7 +39,11 @@ async def get_result_and_steps(langchain_object, inputs: Union[dict, str], **kwa if isinstance(output, dict) else output ) - thought = format_actions(intermediate_steps) if intermediate_steps else "" + try: + thought = format_actions(intermediate_steps) if intermediate_steps else "" + except Exception as exc: + logger.exception(exc) + thought = "" except Exception as exc: logger.exception(exc) raise ValueError(f"Error: {str(exc)}") from exc