fix: creating a model in Manage Ollama shows no error when Ollama rejects it (#32196)

When Ollama rejected a new model in the Manage Ollama dialog, for example a model definition with no base model, the form cleared and showed no error, so the admin could not tell the model was never created or why. The dialog now shows Ollama's error and keeps the entered name and definition, so the admin can correct them and try again.

Fixes #32002
This commit is contained in:
Classic298 authored and GitHub committed 2026-10-10 20:11:53 +04:00
1 parent aaea99005d
commit eebf6438ab
1 file changed
+7
@@ -454,6 +454,13 @@
return null;
});
if (res && !res.ok) {
createModelLoading = false;
const error = await res.json();
toast.error(error.detail);
return;
}
if (res && res.ok) {
const reader = res.body
.pipeThrough(new TextDecoderStream())