handle server side errors

This commit is contained in:
Benjamin Palko 2025-05-05 21:49:00 -04:00
parent aa968fd61e
commit 817c3a78ac

13
src/hooks.server.ts Normal file
View file

@ -0,0 +1,13 @@
import type { HandleServerError } from '@sveltejs/kit';
import { randomUUID } from 'crypto';
export const handleError: HandleServerError = async ({ error, event, message, status }) => {
const errorId = randomUUID();
console.error(error, { errorId, event, message, status });
return {
message: 'An Internal Error Occurred',
errorId
};
};