]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
ui: simplify network error handling (#23431)
authorMarcos Del Sol Vives <redacted>
Tue, 2 Jun 2026 08:45:25 +0000 (10:45 +0200)
committerGitHub <redacted>
Tue, 2 Jun 2026 08:45:25 +0000 (10:45 +0200)
commit69cea5b6692341a51e9705b83743f4be96fcb182
tree033e7acee6190278a4022a5237db51d89a000d7a
parentf8e67fc58335a1495ca1b3cd6827cbd44503800e
ui: simplify network error handling (#23431)

Previously error to string conversion was split in two different files,
with one converting errors into strings, and another function analyzing
those strings to generate yet another string.

Now the the error handling for network fetches has been centralised and
uses directly HTTP error codes whereas possible to generate the
human-readable error strings.

It also fixes an issue where all JSON errors reported from the backend,
such as "Invalid API key", would get turned incorrectly in to
"Failed to connect to server" due to poor matching logic in the
now-gone getErrorMessage function.
tools/ui/src/lib/constants/error.ts [new file with mode: 0644]
tools/ui/src/lib/stores/server.svelte.ts
tools/ui/src/lib/utils/api-fetch.ts