fix: reconfigure sentry for the frontend

This commit is contained in:
swve 2024-01-04 23:40:31 +01:00
parent becf0a5c2f
commit 98d2d7cf83
12 changed files with 203 additions and 139 deletions

View file

@ -0,0 +1,24 @@
"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>
);
}