feat: improve error handling

This commit is contained in:
Michael Zetterberg
2024-05-31 09:22:17 +02:00
parent 3ea53c907e
commit 19d8b757cd
2 changed files with 24 additions and 1 deletions

View File

@@ -13,7 +13,9 @@ export default function Error({
return (
<p>
<strong>Breadcrumbs failed for this page ({error.digest})</strong>
<strong>
Breadcrumbs failed for this page ({error.digest}@{Date.now()})
</strong>
</p>
)
}

View File

@@ -0,0 +1,21 @@
"use client"
import { useEffect } from "react"
export default function Error({
error,
}: {
error: Error & { digest?: string }
}) {
useEffect(() => {
console.error({ breadcrumbsError: error })
}, [error])
return (
<p>
<strong>
Error loading this page ({error.digest}@{Date.now()})
</strong>
</p>
)
}