learnhouse/apps/web/app/global-error.tsx
2024-02-09 21:22:15 +01:00

24 lines
527 B
TypeScript

'use client'
import * as Sentry from '@sentry/nextjs'
import NextError from 'next/error'
import { useEffect } from 'react'
export default function GlobalError({
error,
}: {
error: Error & { digest?: string }
}) {
useEffect(() => {
Sentry.captureException(error)
}, [error])
return (
<html>
<body>
{/* This is the default Next.js error component but it doesn't allow omitting the statusCode property yet. */}
<NextError statusCode={undefined as any} />
</body>
</html>
)
}