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.

fix: handle EndpointSetupFailedError in BasePluginClient (#19613)

Yeuolyff0feaf34ea7
diff --git a/api/core/plugin/endpoint/exc.py b/api/core/plugin/endpoint/exc.py
new file mode 100644
index 00000000000..aa29f1e9a19
--- /dev/null
+++ b/api/core/plugin/endpoint/exc.py
@@ -0,0 +1,6 @@
+class EndpointSetupFailedError(ValueError):
+ """
+ Endpoint setup failed error
+ """
+
+ pass
diff --git a/api/core/plugin/impl/base.py b/api/core/plugin/impl/base.py
index 4f1d808a3ec..591e7b05256 100644
--- a/api/core/plugin/impl/base.py
+++ b/api/core/plugin/impl/base.py
@@ -17,6 +17,7 @@ from core.model_runtime.errors.invoke import (
InvokeServerUnavailableError,
)
from core.model_runtime.errors.validate import CredentialsValidateFailedError
+from core.plugin.endpoint.exc import EndpointSetupFailedError
from core.plugin.entities.plugin_daemon import PluginDaemonBasicResponse, PluginDaemonError, PluginDaemonInnerError
from core.plugin.impl.exc import (
PluginDaemonBadRequestError,
@@ -219,6 +220,8 @@ class BasePluginClient:
raise InvokeServerUnavailableError(description=args.get("description"))
case CredentialsValidateFailedError.__name__:
raise CredentialsValidateFailedError(error_object.get("message"))
+ case EndpointSetupFailedError.__name__:
+ raise EndpointSetupFailedError(error_object.get("message"))
case _:
raise PluginInvokeError(description=message)
case PluginDaemonInternalServerError.__name__: