mirror of
https://github.com/immich-app/immich.git
synced 2025-07-03 21:40:00 +02:00
fix(web): login error handling (#1322)
This commit is contained in:
parent
ba04b753de
commit
5fb3ea465f
7 changed files with 154 additions and 35 deletions
web/src
|
@ -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'
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue