feat: add error boundary to handle route errors with detailed messages

This commit is contained in:
Ardeman
2025-03-11 22:56:30 +08:00
parent ea6462f3ea
commit 2b253633a5
2 changed files with 33 additions and 2 deletions
+2 -2
View File
@@ -74,11 +74,11 @@ export const ErrorBoundary = ({ error }: Route.ErrorBoundaryProps) => {
}
return (
<main className="container mx-auto p-4 pt-16">
<main className="container mx-auto p-4">
<h1>{message}</h1>
<p>{details}</p>
{stack && (
<pre className="w-full overflow-x-auto p-4">
<pre className="w-full p-4 whitespace-pre-wrap">
<code>{stack}</code>
</pre>
)}