Update 1.2.2.2 beta

This commit is contained in:
MacRimi
2026-06-19 23:38:57 +02:00
parent 22a8cbc402
commit 3fd7f4b2a4
8 changed files with 7758 additions and 232 deletions
+7 -2
View File
@@ -149,10 +149,15 @@ export async function fetchApi<T>(endpoint: string, options?: RequestInit): Prom
}
}
} catch (parseErr) {
if (parseErr instanceof Error && parseErr.message.includes("API request failed")) {
// Backend-supplied detail (the explicit `throw new Error(detail)`
// above) MUST propagate so the UI shows "path does not exist…"
// instead of the generic "API request failed: 400 BAD REQUEST".
// Only swallow when the JSON itself failed to parse — that's a
// real SyntaxError and falling through to the generic message
// is the right behaviour there.
if (!(parseErr instanceof SyntaxError)) {
throw parseErr
}
// JSON parse failed — fall through to the generic message.
}
throw new Error(`API request failed: ${response.status} ${response.statusText}`)
}