Skip to content

Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active

Fix: catch uncaught OpenAIError handling in server index.js and log info (#1248)

Danny Avila53d0ffcd112e
diff --git a/api/server/index.js b/api/server/index.js
index dd497282fb..d8d1c18053 100644
--- a/api/server/index.js
+++ b/api/server/index.js
@@ -101,7 +101,16 @@ process.on('uncaughtException', (err) => {
console.error('Meilisearch error, search will be disabled');
messageCount++;
}
- } else {
- process.exit(1);
+
+ return;
}
+
+ if (err.message.includes('OpenAIError')) {
+ console.error(
+ '\n\nAn Uncaught `OpenAIError` error may be due to your reverse-proxy setup or stream configuration, or a bug in the `openai` node package.',
+ );
+ return;
+ }
+
+ process.exit(1);
});