From bf9b28d199c227504af3ca397750cf4f40d93afc Mon Sep 17 00:00:00 2001 From: Sakamoto Shiina <68018796+ShiinaSakamoto@users.noreply.github.com> Date: Mon, 22 Dec 2025 16:00:19 +0900 Subject: [PATCH] [Fix] UI: Fix error handling for LMStudio and Ollama connections. --- src-ui/logics/_useBackendErrorHandling.js | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src-ui/logics/_useBackendErrorHandling.js b/src-ui/logics/_useBackendErrorHandling.js index b47cf00d..b7ae7f6b 100644 --- a/src-ui/logics/_useBackendErrorHandling.js +++ b/src-ui/logics/_useBackendErrorHandling.js @@ -211,7 +211,6 @@ export const _useBackendErrorHandling = () => { return; case "/set/data/selected_openai_model": - console.log(data); if (message === "OpenAI model is not valid") { updateSelectedOpenAIModel(data); showNotification_Error(message, { category_id: "selected_openai_model" }); @@ -344,15 +343,23 @@ export const _useBackendErrorHandling = () => { return; case "/run/lmstudio_connection": - updateIsLMStudioConnected(data); - showNotification_Error(message); - console.error(message); + if (message === "Cannot connect to LMStudio server") { + updateIsLMStudioConnected(data); + showNotification_Error(message, { category_id: "lmstudio_connection" }); + } else { + updateIsLMStudioConnected(data); + showNotification_Error(message, { category_id: "lmstudio_connection" }); + } return; case "/run/ollama_connection": - updateIsOllamaConnected(data); - showNotification_Error(message); - console.error(message); + if (message === "Cannot connect to ollama server") { + updateIsOllamaConnected(data); + showNotification_Error(message, { category_id: "ollama_connection" }); + } else { + updateIsOllamaConnected(data); + showNotification_Error(message, { category_id: "ollama_connection" }); + } return; default: