diff --git a/surfsense_web/app/dashboard/error.tsx b/surfsense_web/app/dashboard/error.tsx new file mode 100644 index 000000000..4d872a69f --- /dev/null +++ b/surfsense_web/app/dashboard/error.tsx @@ -0,0 +1,44 @@ +"use client"; + +import Link from "next/link"; +import { useEffect } from "react"; + +export default function DashboardError({ + error, + reset, +}: { + error: globalThis.Error & { digest?: string }; + reset: () => void; +}) { + useEffect(() => { + import("posthog-js") + .then(({ default: posthog }) => { + posthog.captureException(error); + }) + .catch(() => {}); + }, [error]); + + return ( +
+ An error occurred in this section. Your dashboard is still available. +
+