Added this stupid vibecoded app as a test
Build App / Build (push) Waiting to run

This commit is contained in:
2026-08-06 09:58:06 +02:00
parent d9e05fb487
commit a9860f4c94
51 changed files with 10154 additions and 7 deletions
@@ -0,0 +1,21 @@
import { goto } from '$app/navigation';
import { session } from '$lib/stores/session.svelte';
import { ApiError } from './client';
/**
* Turns a failed call into something to show the user.
*
* A 401 means the 16-minute JWT lapsed mid-session: there is nothing useful to
* display, so the session is dropped and the user is sent back to `/login`, and
* this returns null.
*/
export function toErrorMessage(cause: unknown, fallback: string): string | null {
if (cause instanceof ApiError && cause.status === 401) {
session.clear();
void goto('/login', { replaceState: true });
return null;
}
// ApiError already carries the API's own `message`, or "unreachable" for status 0.
return cause instanceof ApiError ? cause.message : fallback;
}