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.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
feat: optimize openai error raise (#459)
John Wangdf5763be37c9
diff --git a/api/core/llm/error_handle_wraps.py b/api/core/llm/error_handle_wraps.pyindex ae9a0278bb8..2bddebc26ad 100644--- a/api/core/llm/error_handle_wraps.py+++ b/api/core/llm/error_handle_wraps.py@@ -17,14 +17,16 @@ def handle_llm_exceptions(func):raise LLMBadRequestError(str(e))except openai.error.APIConnectionError as e:logging.exception("Failed to connect to OpenAI API.")- raise LLMAPIConnectionError(str(e))+ raise LLMAPIConnectionError(e.__class__.__name__ + ":" + str(e))except (openai.error.APIError, openai.error.ServiceUnavailableError, openai.error.Timeout) as e:logging.exception("OpenAI service unavailable.")- raise LLMAPIUnavailableError(str(e))+ raise LLMAPIUnavailableError(e.__class__.__name__ + ":" + str(e))except openai.error.RateLimitError as e:raise LLMRateLimitError(str(e))except openai.error.AuthenticationError as e:raise LLMAuthorizationError(str(e))+ except openai.error.OpenAIError as e:+ raise LLMBadRequestError(e.__class__.__name__ + ":" + str(e))return wrapper@@ -39,13 +41,15 @@ def handle_llm_exceptions_async(func):raise LLMBadRequestError(str(e))except openai.error.APIConnectionError as e:logging.exception("Failed to connect to OpenAI API.")- raise LLMAPIConnectionError(str(e))+ raise LLMAPIConnectionError(e.__class__.__name__ + ":" + str(e))except (openai.error.APIError, openai.error.ServiceUnavailableError, openai.error.Timeout) as e:logging.exception("OpenAI service unavailable.")- raise LLMAPIUnavailableError(str(e))+ raise LLMAPIUnavailableError(e.__class__.__name__ + ":" + str(e))except openai.error.RateLimitError as e:raise LLMRateLimitError(str(e))except openai.error.AuthenticationError as e:raise LLMAuthorizationError(str(e))+ except openai.error.OpenAIError as e:+ raise LLMBadRequestError(e.__class__.__name__ + ":" + str(e))return wrapper