Global error page: ErrorView with per-status copy, did-you-mean suggestions, error ids from handleError, static error.html; 404 instead of 500 for bad progress ids; tolerate full header line in DAISY_TASK_WEBHOOK_HEADER and stop logging raw fetch errors
All checks were successful
Deploy production / deploy (push) Successful in 1m9s

This commit is contained in:
2026-10-25 13:10:50 +00:00
parent f86c8ef294
commit a89a187346
13 changed files with 665 additions and 30 deletions

10
src/hooks.client.ts Normal file
View File

@@ -0,0 +1,10 @@
import type { HandleClientError } from '@sveltejs/kit';
// Errors thrown while rendering/loading in the browser: same shape as the server (short id,
// generic message) so the error page looks the same either way.
export const handleError: HandleClientError = ({ error, status, message }) => {
if (status === 404) return { message: 'Not Found' };
const id = crypto.randomUUID().slice(0, 8);
console.error(`[error ${id}] ${status}`, error);
return { message: status >= 500 ? 'Internal Error' : message, id };
};