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:
parent
121cd5f4d0
commit
8117ade8c9
|
|
@ -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>
|
||||
);
|
||||
}
|
||||
Loading…
Reference in New Issue