diff --git a/Caddyfile b/Caddyfile
index cc9fc4e..392df74 100644
--- a/Caddyfile
+++ b/Caddyfile
@@ -211,6 +211,11 @@
rewrite * /404.html
file_server
}
+ handle_errors 500 {
+ root * /srv/errors
+ rewrite * /500.html
+ file_server
+ }
handle_errors 502 {
root * /srv/errors
rewrite * /502.html
diff --git a/caddy/Dockerfile b/caddy/Dockerfile
index d32d510..d78156e 100644
--- a/caddy/Dockerfile
+++ b/caddy/Dockerfile
@@ -7,3 +7,4 @@ RUN xcaddy build \
FROM caddy:2-alpine
COPY --from=builder /usr/bin/caddy /usr/bin/caddy
+COPY errors/ /srv/errors/
diff --git a/caddy/errors/500.html b/caddy/errors/500.html
new file mode 100644
index 0000000..d733bb7
--- /dev/null
+++ b/caddy/errors/500.html
@@ -0,0 +1,203 @@
+
+
+
+
+
+ 500 — Internal Error — LibNovel
+
+
+
+
+
+
+
+
+
+
+ 500
+
+
+
+ Something went wrong
+ An unexpected error occurred on our end. We're on it — try again in a moment.
+
+
+
+ Auto-refreshing in 20s
+
+
+
+
+
+
+
+
diff --git a/ui/src/error.html b/ui/src/error.html
new file mode 100644
index 0000000..0354524
--- /dev/null
+++ b/ui/src/error.html
@@ -0,0 +1,209 @@
+
+
+
+
+
+ %sveltekit.status% — LibNovel
+
+
+
+
+
+
+
+
+
+
+ %sveltekit.status%
+
+
+
+
Something went wrong
+
+
+ The page couldn't load
+ An unexpected error occurred. We're looking into it — try again in a moment.
+
+
+
+ Auto-refreshing in 20s
+
+
+
+
+
+
+
+
diff --git a/ui/src/routes/+error.svelte b/ui/src/routes/+error.svelte
index c557a1d..8cc605b 100644
--- a/ui/src/routes/+error.svelte
+++ b/ui/src/routes/+error.svelte
@@ -17,35 +17,78 @@
);
const code = $derived(String(status));
+ const is404 = $derived(status === 404);
{m.error_status({ status: code })} · libnovel
-
-
-
-
+
+
+
+ {#if is404}
+
+
+ {:else}
+
+
+ {/if}
+
+
+
{code}
-
+
-
+
{m.error_go_home()}
+ {#if !is404}
+
+ {/if}
-
libnovel
+
libnovel