Compare commits

...

3 commits

Author SHA1 Message Date
6394e16a45 Use sveltekit fetch instead of window.fetch
All checks were successful
ci/woodpecker/push/build Pipeline was successful
2023-12-22 13:20:49 +01:00
02a6276240 Add error definition 2023-12-22 13:20:37 +01:00
59a6d8ea38 Update error page 2023-12-22 13:20:31 +01:00
3 changed files with 53 additions and 1 deletions

View file

@ -2,7 +2,10 @@
// for information about these interfaces // for information about these interfaces
declare global { declare global {
namespace App { namespace App {
// interface Error {} export interface Error {
status: number;
message: string;
}
// interface Locals {} // interface Locals {}
// interface PageData {} // interface PageData {}
// interface Platform {} // interface Platform {}

View file

@ -3,6 +3,10 @@ export async function handle({ event, resolve }) {
return response; return response;
} }
export async function handleFetch({ request, fetch }) {
return fetch(request);
}
export async function handleError({ error, event, status, message }) { export async function handleError({ error, event, status, message }) {
console.error(error) console.error(error)
return { return {

View file

@ -0,0 +1,45 @@
<script>
import { page } from '$app/stores';
</script>
<div id='container'>
<div class="wrapper">
<p id="status">{$page.status}</p>
<p id="message">{$page.error.message}</p>
</div>
</div>
<style>
* {
box-sizing: border-box;
padding: 0;
margin: 0;
}
#container {
background-image: url(/splash.webp);
background-size: cover;
display: grid;
place-content: center;
height: 100dvh;
width: 100dvw;
z-index: 99;
position: absolute;
font-size: 24px;
font-family: monospace;
}
.wrapper {
background: transparent;
display: flex;
backdrop-filter: blur(5px);
border-radius: 10px;
border: 1px solid black;
}
#status {
border-right: 1px solid black;
}
p {
padding: 20px;
}
</style>