2023-04-02 15:41:33 +00:00
|
|
|
import { TimelineReader } from '$lib/server/timeline';
|
2023-04-02 15:37:55 +00:00
|
|
|
import type { HandleServerError } from '@sveltejs/kit';
|
|
|
|
|
2023-04-02 15:41:33 +00:00
|
|
|
TimelineReader.init();
|
|
|
|
|
2023-04-02 15:37:55 +00:00
|
|
|
export const handleError = (({ error }) => {
|
|
|
|
if (error instanceof Error) {
|
|
|
|
console.error('Something went wrong: ', error.name, error.message);
|
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
|
|
message: 'Whoops!',
|
|
|
|
code: (error as any)?.code ?? 'UNKNOWN'
|
|
|
|
};
|
|
|
|
}) satisfies HandleServerError;
|