From 8117ade8c9c6e8891fbc8f24bd4e3a0fb338a5e7 Mon Sep 17 00:00:00 2001 From: Enno Gelhaus Date: Thu, 31 Jul 2025 08:24:18 +0200 Subject: [PATCH] Frontend crash UI As per restrictions of react, this needs to be in /apps not /apps/frontend. Though this will only get triggered on the frontend, because the backend doesn't have any UI. --- apps/error.tsx | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 apps/error.tsx diff --git a/apps/error.tsx b/apps/error.tsx new file mode 100644 index 00000000..c72ff572 --- /dev/null +++ b/apps/error.tsx @@ -0,0 +1,29 @@ +'use client'; + +import { useEffect } from 'react'; +import * as Sentry from '@sentry/nextjs'; + +export default function GlobalError({ error }: { error: Error }) { + useEffect(() => { + const eventId = Sentry.captureException(error); + Sentry.showReportDialog({ + eventId, + title: "Something broke!", + subtitle: "Please help us fix the issue by providing some details.", + labelComments: "What happened?", + labelName: "Your name", + labelEmail: "Your email", + labelSubmit: "Send Report", + lang: "en", + }); + }, [error]); + + return ( + + +

Something went wrong

+

{error.message}

+ + + ); +} \ No newline at end of file