feat: Add error handling for fetching Ollama URL
This commit is contained in:
parent
97daaf9dc2
commit
c2c80e2226
@ -15,9 +15,14 @@ export const SettingsOllama = () => {
|
|||||||
const { status } = useQuery({
|
const { status } = useQuery({
|
||||||
queryKey: ["fetchOllamURL"],
|
queryKey: ["fetchOllamURL"],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const [ollamaURL] = await Promise.all([getOllamaURL()])
|
try {
|
||||||
setOllamaURL(ollamaURL)
|
const [ollamaURL] = await Promise.all([getOllamaURL()])
|
||||||
return {}
|
setOllamaURL(ollamaURL)
|
||||||
|
return {}
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e)
|
||||||
|
return {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user