Skip to content

Commit

Permalink
fix: add custom error page
Browse files Browse the repository at this point in the history
  • Loading branch information
johanohly committed Sep 16, 2024
1 parent 543a788 commit 8c5db82
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/routes/+error.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<script lang="ts">
import { page } from '$app/stores';
import { Button } from '$lib/components/ui/button';
</script>

<div class="flex flex-col h-full items-center justify-center">
{#if $page.status === 404}
<h1 class="text-3xl font-bold">404</h1>
<p class="text-lg">Page not found</p>
<Button href="/" variant="outline">Go back</Button>
{:else}
<h1 class="text-4xl font-bold">An unknown error occured</h1>
<p class="text-lg">{$page.error?.message}</p>
<p class="italic text-sm">
If you are the site owner, please check the logs for more information.
</p>
{/if}
</div>

0 comments on commit 8c5db82

Please sign in to comment.