Add handler for client and server errors
This commit is contained in:
parent
fbad879acb
commit
a37f8a3f29
2 changed files with 11 additions and 0 deletions
5
frontend/src/hooks.client.ts
Normal file
5
frontend/src/hooks.client.ts
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
export async function handleError({ error, event, status, message }) {
|
||||||
|
return {
|
||||||
|
message
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,4 +1,10 @@
|
||||||
export async function handle({ event, resolve }) {
|
export async function handle({ event, resolve }) {
|
||||||
const response = await resolve(event);
|
const response = await resolve(event);
|
||||||
return response;
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function handleError({ error, event, status, message }) {
|
||||||
|
return {
|
||||||
|
message
|
||||||
|
};
|
||||||
}
|
}
|
Loading…
Reference in a new issue