From a92ae19b343a10e595e749d759013848a3091b59 Mon Sep 17 00:00:00 2001 From: siegfriedbz Date: Tue, 10 Sep 2024 14:14:58 +0200 Subject: [PATCH] add error boundary --- src/app/error.tsx | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/app/error.tsx diff --git a/src/app/error.tsx b/src/app/error.tsx new file mode 100644 index 00000000..1fbb0186 --- /dev/null +++ b/src/app/error.tsx @@ -0,0 +1,38 @@ +"use client"; + +import { useEffect } from "react"; + +export default function Error({ + error, + reset, +}: { + error: Error & { digest?: string }; + reset: () => void; +}) { + useEffect(() => { + // Log the error to an error reporting service + console.error(error); + }, [error]); + + return ( + <> +
+

+ + Something went wrong :( + +

+ + +
+ + ); +}