From ac45c278c46f120ec87dc2d7dc18ff91a9a2cbaa Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Sat, 30 Mar 2024 16:17:39 -0300 Subject: [PATCH] Refactor error handling in build_vertex function --- src/backend/base/langflow/api/v1/chat.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/backend/base/langflow/api/v1/chat.py b/src/backend/base/langflow/api/v1/chat.py index 996f301e6..9ee4edb03 100644 --- a/src/backend/base/langflow/api/v1/chat.py +++ b/src/backend/base/langflow/api/v1/chat.py @@ -223,7 +223,8 @@ async def build_vertex( except Exception as exc: logger.error(f"Error building vertex: {exc}") logger.exception(exc) - raise HTTPException(status_code=500, detail=str(exc)) from exc + message = parse_exception(exc) + raise HTTPException(status_code=500, detail=message) from exc @router.get("/build/{flow_id}/{vertex_id}/stream", response_class=StreamingResponse)