Files
formbricks-formbricks/apps/web/app/global-error.tsx
2025-08-06 11:23:27 +00:00

23 lines
514 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(() => {
if (process.env.NODE_ENV === "development") {
console.error(error.message);
} else {
Sentry.captureException(error);
}
}, [error]);
return (
<html lang="en-US">
<body>
<NextError statusCode={0} />
</body>
</html>
);
}