1
0
mirror of https://github.com/immich-app/immich.git synced 2024-11-24 08:52:28 +02:00
immich/web/src/hooks.server.ts
2023-01-13 16:04:59 -06:00

16 lines
477 B
TypeScript

import type { Handle, HandleServerError } from '@sveltejs/kit';
import { AxiosError } from 'axios';
export const handle: Handle = async ({ event, resolve }) => {
return await resolve(event);
};
export const handleError: HandleServerError = async ({ error }) => {
const httpError = error as AxiosError;
return {
message: httpError?.message || 'Hmm, not sure about that. Check the logs or open a ticket?',
stack: httpError?.stack,
code: httpError.code || '500'
};
};