From c2c80e2226837b2e17b62edbee1edc21d7b3de1f Mon Sep 17 00:00:00 2001 From: n4ze3m Date: Fri, 24 Jan 2025 22:36:46 +0530 Subject: [PATCH] feat: Add error handling for fetching Ollama URL --- src/components/Option/Settings/ollama.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/components/Option/Settings/ollama.tsx b/src/components/Option/Settings/ollama.tsx index 3f9c6ba..a66eec6 100644 --- a/src/components/Option/Settings/ollama.tsx +++ b/src/components/Option/Settings/ollama.tsx @@ -15,9 +15,14 @@ export const SettingsOllama = () => { const { status } = useQuery({ queryKey: ["fetchOllamURL"], queryFn: async () => { - const [ollamaURL] = await Promise.all([getOllamaURL()]) - setOllamaURL(ollamaURL) - return {} + try { + const [ollamaURL] = await Promise.all([getOllamaURL()]) + setOllamaURL(ollamaURL) + return {} + } catch (e) { + console.error(e) + return {} + } } })