Feature/wrap logging * feat: change all logging to go through our own logger function so that we can control log levels * move packages/trpc to using our own logger * merge Approved-by: Linus Flood
22 lines
378 B
TypeScript
22 lines
378 B
TypeScript
"use client"
|
|
|
|
import * as Sentry from "@sentry/nextjs"
|
|
import { useEffect } from "react"
|
|
|
|
import { logger } from "@scandic-hotels/common/logger"
|
|
|
|
export default function Error({
|
|
error,
|
|
}: {
|
|
error: Error & { digest?: string }
|
|
}) {
|
|
useEffect(() => {
|
|
if (!error) return
|
|
|
|
logger.error("header", error)
|
|
Sentry.captureException(error)
|
|
}, [error])
|
|
|
|
return null
|
|
}
|