fix: connection check shows Network Problem instead of the real error (#35346)

Verifying an Anthropic or Ollama connection with a wrong API key showed only "OpenAI: Network Problem" or "Ollama: Network Problem", while the actual reason from the provider was there but got lost. The toast now shows the provider's error, and OpenAI-compatible connections still show theirs.

Fixes #35345
This commit is contained in:
Classic298 authored and GitHub committed 2026-11-30 18:25:36 +04:00
1 parent 68b0f9e6ea
commit 36522bbbb6
3 files changed
+4 -2

No files matched your search

+2
View File
@@ -1117,6 +1117,8 @@ async def verify_connection(
# ClientError covers all aiohttp requests issues
log.exception(f'Client error: {str(e)}')
raise HTTPException(status_code=500, detail=ERROR_MESSAGES.SERVER_CONNECTION_ERROR)
except HTTPException:
raise
except Exception as e:
log.exception(f'Unexpected error: {e}')
raise HTTPException(status_code=500, detail=ERROR_MESSAGES.SERVER_CONNECTION_ERROR)
+1 -1
View File
@@ -19,7 +19,7 @@ export const verifyOllamaConnection = async (token: string = '', connection: dic
return res.json();
})
.catch((err) => {
error = `Ollama: ${err?.error?.message ?? 'Network Problem'}`;
error = `Ollama: ${err?.detail ?? err?.error?.message ?? 'Network Problem'}`;
return [];
});
+1 -1
View File
@@ -333,7 +333,7 @@ export const verifyOpenAIConnection = async (
return res.json();
})
.catch((err) => {
error = `OpenAI: ${err?.error?.message ?? 'Network Problem'}`;
error = `OpenAI: ${err?.detail ?? err?.error?.message ?? 'Network Problem'}`;
return [];
});