[Fix] UI: Fix error handling for LMStudio and Ollama connections.
This commit is contained in:
@@ -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":
|
||||
if (message === "Cannot connect to LMStudio server") {
|
||||
updateIsLMStudioConnected(data);
|
||||
showNotification_Error(message);
|
||||
console.error(message);
|
||||
showNotification_Error(message, { category_id: "lmstudio_connection" });
|
||||
} else {
|
||||
updateIsLMStudioConnected(data);
|
||||
showNotification_Error(message, { category_id: "lmstudio_connection" });
|
||||
}
|
||||
return;
|
||||
|
||||
case "/run/ollama_connection":
|
||||
if (message === "Cannot connect to ollama server") {
|
||||
updateIsOllamaConnected(data);
|
||||
showNotification_Error(message);
|
||||
console.error(message);
|
||||
showNotification_Error(message, { category_id: "ollama_connection" });
|
||||
} else {
|
||||
updateIsOllamaConnected(data);
|
||||
showNotification_Error(message, { category_id: "ollama_connection" });
|
||||
}
|
||||
return;
|
||||
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user