36 lines
670 B
TypeScript
36 lines
670 B
TypeScript
"use client"
|
|
|
|
import * as Sentry from "@sentry/nextjs"
|
|
import { useEffect } from "react"
|
|
import { useIntl } from "react-intl"
|
|
|
|
import styles from "./global-error.module.css"
|
|
|
|
export default function GlobalError({
|
|
error,
|
|
}: {
|
|
error: Error & { digest?: string }
|
|
}) {
|
|
console.log({ global_error: error })
|
|
|
|
const intl = useIntl()
|
|
|
|
useEffect(() => {
|
|
Sentry.captureException(error)
|
|
}, [error])
|
|
|
|
return (
|
|
<html>
|
|
<body>
|
|
<div className={styles.layout}>
|
|
<h1>
|
|
{intl.formatMessage({
|
|
defaultMessage: "Something went really wrong!",
|
|
})}
|
|
</h1>
|
|
</div>
|
|
</body>
|
|
</html>
|
|
)
|
|
}
|