Improve error handling

This commit is contained in:
2026-05-16 15:10:49 +01:00
parent 6ed262ce59
commit 808b576df1
5 changed files with 25 additions and 3 deletions

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

@@ -0,0 +1,11 @@
import type { HandleClientError } from "@sveltejs/kit";
export const handleError: HandleClientError = ({ error }) => {
const err = error as any;
return {
message: err?.message || 'An unexpected application error occurred.',
code: err?.code || 'CRITICAL',
msg: err?.msg || 'UNHANDLED_EXCEPTION'
};
};