decent 404/error page

This commit is contained in:
2025-12-31 12:00:44 -05:00
parent ff681e6b3a
commit bc2a74be50
6 changed files with 770 additions and 276 deletions

27
src/routes/error-test.tsx Normal file
View File

@@ -0,0 +1,27 @@
import { createSignal, onMount } from "solid-js";
export default function ErrorTest() {
const [shouldCrash, setShouldCrash] = createSignal(false);
// Crash on mount if flag is set
if (shouldCrash()) {
throw new Error("Test error - Error boundary triggered!");
}
return (
<div class="bg-crust flex min-h-screen items-center justify-center">
<div class="bg-surface0 max-w-md rounded-lg p-8 text-center shadow-lg">
<h1 class="text-text mb-4 text-2xl font-bold">Error Boundary Test</h1>
<p class="text-subtext0 mb-6">
Click the button below to trigger the error boundary
</p>
<button
onClick={() => setShouldCrash(true)}
class="bg-red hover:bg-maroon rounded px-6 py-3 text-base font-bold transition"
>
💥 Trigger Error Boundary
</button>
</div>
</div>
);
}