add error page

This commit is contained in:
Nikita Galaiko 2023-02-27 14:41:25 +01:00
parent 85d8d16e0d
commit 34f868fb95
No known key found for this signature in database
GPG Key ID: EBAB54E845BA519D

22
src/routes/+error.svelte Normal file
View File

@ -0,0 +1,22 @@
<script lang="ts">
import { page } from '$app/stores';
import { log } from '$lib';
$: if ($page.error) {
log.error($page.url, $page.error);
} else {
log.error($page.url, $page.status);
}
$: message = $page.error
? $page.error.message
: $page.status === 404
? 'Page not found'
: 'Something went wrong';
</script>
<div class="flex flex-1 h-full">
<h1 class="m-auto text-xl">
{message} :(
</h1>
</div>