We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8c3b8aa commit 0121e21Copy full SHA for 0121e21
app/global-error.tsx
@@ -0,0 +1,33 @@
1
+//
2
+// Route des erreurs globales émises par Next.js.
3
+// Source : https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/#react-render-errors-in-app-router
4
5
+
6
+"use client";
7
8
+// Importation des dépendances.
9
+import NextError from "next/error";
10
+import { useEffect } from "react";
11
+import { captureException } from "@sentry/nextjs";
12
13
+export default function GlobalError( {
14
+ error
15
+}: {
16
+ error: Error & { digest?: string };
17
+} )
18
+{
19
+ // Capture de l'erreur avec Sentry.
20
+ useEffect( () =>
21
+ {
22
+ captureException( error );
23
+ }, [ error ] );
24
25
+ // Affichage du rendu HTML du composant.
26
+ return (
27
+ <html lang="en">
28
+ <body>
29
+ <NextError statusCode={undefined as never} />
30
+ </body>
31
+ </html>
32
+ );
33
+}
0 commit comments