AIdentity

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

global-error.tsx (664B)


      1 "use client";
      2 
      3 import * as Sentry from "@sentry/nextjs";
      4 import NextError from "next/error";
      5 import { useEffect } from "react";
      6 
      7 export default function GlobalError({ error }: { error: Error & { digest?: string } }) {
      8   useEffect(() => {
      9     Sentry.captureException(error);
     10   }, [error]);
     11 
     12   return (
     13     <html>
     14       <body>
     15         {/* `NextError` is the default Next.js error page component. Its type
     16         definition requires a `statusCode` prop. However, since the App Router
     17         does not expose status codes for errors, we simply pass 0 to render a
     18         generic error message. */}
     19         <NextError statusCode={0} />
     20       </body>
     21     </html>
     22   );
     23 }