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.
This commit is contained in:
Enno Gelhaus 2025-07-31 08:24:18 +02:00 committed by GitHub
parent 121cd5f4d0
commit 8117ade8c9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 29 additions and 0 deletions

29
apps/error.tsx Normal file
View File

@ -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 (
<html>
<body>
<h2>Something went wrong</h2>
<p>{error.message}</p>
</body>
</html>
);
}