26 lines
424 B
TypeScript
26 lines
424 B
TypeScript
"use client"
|
|
|
|
import * as Sentry from "@sentry/nextjs"
|
|
import { useEffect } from "react"
|
|
|
|
export default function Error({
|
|
error,
|
|
}: {
|
|
error: Error & { digest?: string }
|
|
}) {
|
|
useEffect(() => {
|
|
if (!error) return
|
|
|
|
console.error(error)
|
|
Sentry.captureException(error)
|
|
}, [error])
|
|
|
|
return (
|
|
<p>
|
|
<strong>
|
|
Error loading this page ({error.digest}@{Date.now()})
|
|
</strong>
|
|
</p>
|
|
)
|
|
}
|