From 6500d793d15fe8d043c64146d7b35d52f06d9038 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Mon, 18 Sep 2023 10:39:29 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(types.py):=20fix=20indentati?= =?UTF-8?q?on=20and=20remove=20duplicate=20docstring=20to=20improve=20code?= =?UTF-8?q?=20readability=20=F0=9F=94=A5=20chore(types.py):=20remove=20unu?= =?UTF-8?q?sed=20variable=20'e'=20and=20improve=20exception=20handling=20b?= =?UTF-8?q?y=20adding=20'from=20exc'=20to=20preserve=20original=20tracebac?= =?UTF-8?q?k?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backend/langflow/interface/types.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/backend/langflow/interface/types.py b/src/backend/langflow/interface/types.py index 30f56b46e..c43a22e01 100644 --- a/src/backend/langflow/interface/types.py +++ b/src/backend/langflow/interface/types.py @@ -289,8 +289,8 @@ def add_base_classes(frontend_node, return_types: List[str]): def build_langchain_template_custom_component(custom_component: CustomComponent): + """Build a custom component template for the langchain""" try: - """Build a custom component template for the langchain""" logger.debug("Building custom component template") frontend_node = build_frontend_node(custom_component) @@ -316,7 +316,7 @@ def build_langchain_template_custom_component(custom_component: CustomComponent) ) logger.debug("Added base classes") return frontend_node - except Exception as e: + except Exception as exc: raise HTTPException( status_code=400, detail={ @@ -325,7 +325,7 @@ def build_langchain_template_custom_component(custom_component: CustomComponent) ), "traceback": traceback.format_exc(), }, - ) + ) from exc def load_files_from_path(path: str):