32 lines
607 B
TypeScript
32 lines
607 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({ id: "Something went really wrong!" })}</h1>
|
|
</div>
|
|
</body>
|
|
</html>
|
|
)
|
|
}
|