refactor(web/api): errCode + errMessage helpers; 41 sites migrated (W1)

This commit is contained in:
2026-05-07 22:17:45 -04:00
parent 965df28127
commit 9c91a342e2
16 changed files with 138 additions and 70 deletions
@@ -2,7 +2,7 @@
import { Trash2 } from 'lucide-svelte';
import { useQueryClient } from '@tanstack/svelte-query';
import { removeTrack } from '$lib/api/admin/tracks';
import { copyForCode } from '$lib/api/error-copy';
import { errMessage } from '$lib/api/errors';
import { qk } from '$lib/api/queries';
import type { TrackRef } from '$lib/api/types';
@@ -45,8 +45,7 @@
// surface (if any) can pick up the flag.
onClose();
} catch (e: unknown) {
const code = (e as { code?: string })?.code ?? 'unknown';
error = copyForCode(code);
error = errMessage(e);
} finally {
busy = false;
}