feat(frontend): add basic error pages (fixes #32)

This commit is contained in:
Sam 2023-03-25 14:49:06 +01:00
parent 987ff47704
commit d9aa6e4fae
No known key found for this signature in database
GPG key ID: B4EF20DDE721CAA1
2 changed files with 47 additions and 0 deletions

View file

@ -0,0 +1,25 @@
<script lang="ts">
import { page } from "$app/stores";
</script>
<h1>An error occurred ({$page.status})</h1>
{#if $page.status === 404}
<p>
The page you were looking for was not found. If you're sure the page exists, check for any typos
in the address.
</p>
{:else if $page.status === 429}
<p>You've exceeded a rate limit, please try again later.</p>
{:else if $page.status === 500}
<p>An internal error occurred. Please try again later.</p>
<p>
If this error keeps happening, please <a
href="https://codeberg.org/u1f320/pronouns.cc/issues"
target="_blank"
rel="noreferrer">file a bug report</a
> with an explanation of what you did to cause the error.
</p>
{/if}
<p>Error message: <code>{$page.error?.message}</code></p>

View file

@ -0,0 +1,22 @@
<script lang="ts">
import { page } from "$app/stores";
</script>
<h1>An error occurred ({$page.status})</h1>
{#if $page.status === 404}
<p>The user you were looking for couldn't be found. Please check for any typos.</p>
{:else if $page.status === 429}
<p>You've exceeded a rate limit, please try again later.</p>
{:else if $page.status === 500}
<p>An internal error occurred. Please try again later.</p>
<p>
If this error keeps happening, please <a
href="https://codeberg.org/u1f320/pronouns.cc/issues"
target="_blank"
rel="noreferrer">file a bug report</a
> with an explanation of what you did to cause the error.
</p>
{/if}
<p>Error message: <code>{$page.error?.message}</code></p>