mirror of
https://github.com/prowler-cloud/prowler.git
synced 2025-12-19 05:17:47 +00:00
Co-authored-by: Alan Buscaglia <gentlemanprogramming@gmail.com> Co-authored-by: Pepe Fagoaga <pepe@prowler.com>
41 lines
838 B
TypeScript
41 lines
838 B
TypeScript
"use client";
|
|
|
|
import * as Sentry from "@sentry/nextjs";
|
|
import NextError from "next/error";
|
|
import { useEffect } from "react";
|
|
|
|
import { SentryErrorSource, SentryErrorType } from "@/sentry";
|
|
|
|
export default function GlobalError({
|
|
error,
|
|
reset: _reset,
|
|
}: {
|
|
error: Error & { digest?: string };
|
|
reset: () => void;
|
|
}) {
|
|
useEffect(() => {
|
|
Sentry.captureException(error, {
|
|
tags: {
|
|
error_boundary: "global",
|
|
error_type: SentryErrorType.APPLICATION_ERROR,
|
|
error_source: SentryErrorSource.ERROR_BOUNDARY,
|
|
digest: error.digest,
|
|
},
|
|
level: "error",
|
|
contexts: {
|
|
react: {
|
|
componentStack: error.stack,
|
|
},
|
|
},
|
|
});
|
|
}, [error]);
|
|
|
|
return (
|
|
<html lang="en">
|
|
<body>
|
|
<NextError statusCode={500} />
|
|
</body>
|
|
</html>
|
|
);
|
|
}
|