Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

refactor: preserve exception context when re-raising in except blocks (#40432)

Valor93287f22a82b
diff --git a/api/core/plugin/impl/base.py b/api/core/plugin/impl/base.py
index e26a04e71ae..f8d8dbfc981 100644
--- a/api/core/plugin/impl/base.py
+++ b/api/core/plugin/impl/base.py
@@ -380,8 +380,8 @@ class BasePluginClient:
if rep.code == -500:
try:
error = PluginDaemonError.model_validate(json.loads(rep.message))
- except Exception:
- raise PluginDaemonInnerError(code=rep.code, message=rep.message)
+ except Exception as e:
+ raise PluginDaemonInnerError(code=rep.code, message=rep.message) from e
logger.error("Error in stream response for plugin %s", rep.__dict__)
self._handle_plugin_daemon_error(error.error_type, error.message)