From 7499722867dafaa576a63b100acb4ec9f50b54b4 Mon Sep 17 00:00:00 2001 From: Sean Morley Date: Fri, 18 Apr 2025 21:55:30 -0400 Subject: [PATCH] feat: Add server error handling and SVG asset for 500 error page --- .../src/lib/assets/undraw_server_error.svg | 1 + frontend/src/routes/+error.svelte | 50 +++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 frontend/src/lib/assets/undraw_server_error.svg diff --git a/frontend/src/lib/assets/undraw_server_error.svg b/frontend/src/lib/assets/undraw_server_error.svg new file mode 100644 index 0000000..0daa182 --- /dev/null +++ b/frontend/src/lib/assets/undraw_server_error.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/routes/+error.svelte b/frontend/src/routes/+error.svelte index 4cff1c8..20fa13e 100644 --- a/frontend/src/routes/+error.svelte +++ b/frontend/src/routes/+error.svelte @@ -2,6 +2,7 @@ import { goto } from '$app/navigation'; import { page } from '$app/stores'; import Lost from '$lib/assets/undraw_lost.svg'; + import ServerError from '$lib/assets/undraw_server_error.svg'; {#if $page.status === 404} @@ -24,3 +25,52 @@ {/if} + +{#if $page.status === 500} +
+
+ Lost in the forest +

+ {$page.status}: {$page.error?.message} +

+

+ Oops, looks like something went wrong. +

+ +

+ AdventureLog server encountered an error while processing your request. +
+ Please check the server logs for more information. +

+ +
+

+ Administrators: Please check your setup using the + documentation. +

+
+ + + {#if $page.url.pathname === '/login' || $page.url.pathname === '/signup'} +
+

+ Hint: If you are an administrator, please check your PUBLIC_SERVER_URL + in the frontend config to make sure it can reach the backend. +
+

+
+ {/if} + +
+ +
+
+
+{/if}