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: run model serval ex not return (#915)

takatost2a27dad2fb62
diff --git a/api/core/model_providers/models/llm/azure_openai_model.py b/api/core/model_providers/models/llm/azure_openai_model.py
index b2f6159b4f0..66acaaeaa10 100644
--- a/api/core/model_providers/models/llm/azure_openai_model.py
+++ b/api/core/model_providers/models/llm/azure_openai_model.py
@@ -166,7 +166,7 @@ class AzureOpenAIModel(BaseLLM):
elif isinstance(ex, openai.error.RateLimitError):
return LLMRateLimitError('Azure ' + str(ex))
elif isinstance(ex, openai.error.AuthenticationError):
- raise LLMAuthorizationError('Azure ' + str(ex))
+ return LLMAuthorizationError('Azure ' + str(ex))
elif isinstance(ex, openai.error.OpenAIError):
return LLMBadRequestError('Azure ' + ex.__class__.__name__ + ":" + str(ex))
else:
diff --git a/api/core/model_providers/models/llm/openai_model.py b/api/core/model_providers/models/llm/openai_model.py
index e3dab3e9d77..e7026c02410 100644
--- a/api/core/model_providers/models/llm/openai_model.py
+++ b/api/core/model_providers/models/llm/openai_model.py
@@ -185,7 +185,7 @@ class OpenAIModel(BaseLLM):
elif isinstance(ex, openai.error.RateLimitError):
return LLMRateLimitError(str(ex))
elif isinstance(ex, openai.error.AuthenticationError):
- raise LLMAuthorizationError(str(ex))
+ return LLMAuthorizationError(str(ex))
elif isinstance(ex, openai.error.OpenAIError):
return LLMBadRequestError(ex.__class__.__name__ + ":" + str(ex))
else: