mirror of
https://github.com/immich-app/immich.git
synced 2025-11-24 11:20:40 +09:00
fix(web): login error handling (#1322)
This commit is contained in:
@@ -1,5 +1,15 @@
|
||||
import type { Handle } from '@sveltejs/kit';
|
||||
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'
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user