debug: add error boundary to show actual error message

This commit is contained in:
Michess
2026-04-13 13:52:44 +02:00
parent 39592bd579
commit 446fce247f

17
client/src/app/error.tsx Normal file
View File

@@ -0,0 +1,17 @@
"use client";
import { useEffect } from "react";
export default function Error({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) {
useEffect(() => {
console.error("App error:", error);
}, [error]);
return (
<div className="flex flex-col items-center gap-4 py-20">
<h2 className="text-xl font-bold">Fehler aufgetreten</h2>
<pre className="bg-base-200 rounded p-4 text-sm max-w-xl overflow-auto">{error.message}</pre>
<button className="btn btn-primary" onClick={reset}>Neu laden</button>
</div>
);
}