feat: proper http error pages (frontend only, closes #3)
This commit is contained in:
parent
b3b897be85
commit
d6bbeec655
@ -34,6 +34,7 @@ server {
|
|||||||
}
|
}
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
|
# If no filepath matches to the requested, 404s will be handled by Svelte
|
||||||
try_files $uri $uri/ /index.html;
|
try_files $uri $uri/ /index.html;
|
||||||
|
|
||||||
# Cache static assets
|
# Cache static assets
|
||||||
@ -42,7 +43,4 @@ server {
|
|||||||
add_header Cache-Control "public, no-transform";
|
add_header Cache-Control "public, no-transform";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Route 404 errors to front page
|
|
||||||
error_page 404 /;
|
|
||||||
}
|
}
|
@ -101,6 +101,22 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@layer components {
|
@layer components {
|
||||||
|
/* * * * * * * * * */
|
||||||
|
/* Error pages */
|
||||||
|
/* * * * * * * * * */
|
||||||
|
|
||||||
|
.error-page-container {
|
||||||
|
@apply flex h-screen w-full flex-col items-center justify-center align-middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
.error-page-emoji {
|
||||||
|
@apply pb-3 text-6xl;
|
||||||
|
}
|
||||||
|
|
||||||
|
.error-page-title {
|
||||||
|
@apply font-copernicus text-2xl;
|
||||||
|
}
|
||||||
|
|
||||||
/* * * * * * * * * * * * */
|
/* * * * * * * * * * * * */
|
||||||
/* Loading animation */
|
/* Loading animation */
|
||||||
/* * * * * * * * * * * * */
|
/* * * * * * * * * * * * */
|
||||||
|
8
web/src/routes/+error.svelte
Normal file
8
web/src/routes/+error.svelte
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import { page } from "$app/state"
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="error-page-container">
|
||||||
|
<p class="error-page-emoji">🫠</p>
|
||||||
|
<h1 class="error-page-title">{page.status} {page.error?.message}</h1>
|
||||||
|
</div>
|
Loading…
x
Reference in New Issue
Block a user