Compare commits

...

3 commits

Author SHA1 Message Date
6df86a1925 ?. where needed
Some checks failed
ci/woodpecker/push/build Pipeline failed
2023-12-22 16:06:21 +01:00
0c4de8c4b4 Update error typdef 2023-12-22 15:52:09 +01:00
5cc5d09430 Handler now sane 2023-12-22 15:51:36 +01:00
4 changed files with 10 additions and 4 deletions

View file

@ -3,8 +3,8 @@
declare global {
namespace App {
export interface Error {
status: number;
message: string;
errorId: string;
}
// interface Locals {}
// interface PageData {}

View file

@ -1,7 +1,10 @@
export async function handleError({ error, event, status, message }) {
const errorId = crypto.randomUUID();
console.error(error)
// console.error(event)
// console.error(status)
return {
status,
errorId,
message
};
}

View file

@ -8,9 +8,12 @@ export async function handleFetch({ request, fetch }) {
}
export async function handleError({ error, event, status, message }) {
const errorId = crypto.randomUUID();
console.error(error)
// console.error(event)
// console.error(status)
return {
status,
errorId,
message
};
}

View file

@ -5,7 +5,7 @@
<div id='container'>
<div class="wrapper">
<p id="status">{$page.status}</p>
<p id="message">{$page.error.message}</p>
<p id="message">{$page.error?.message}</p>
</div>
</div>