Skip to content

πŸ“¨ The ultimate agentic social media scheduling tool πŸ€–

feat: feedback on crash

Nevo David142866805cc2
diff --git a/apps/error.tsx b/apps/error.tsx
deleted file mode 100644
index c72ff5722..000000000
--- a/apps/error.tsx
+++ /dev/null
@@ -1,29 +0,0 @@
-'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>
- );
-}
\ No newline at end of file
diff --git a/apps/frontend/src/app/global-error.tsx b/apps/frontend/src/app/global-error.tsx
index b014f08cb..db4f81ebc 100644
--- a/apps/frontend/src/app/global-error.tsx
+++ b/apps/frontend/src/app/global-error.tsx
@@ -10,11 +10,23 @@ export default function GlobalError({
error: Error & { digest?: string };
}) {
const { sentryDsn } = useVariables();
+
useEffect(() => {
if (!sentryDsn) {
return;
}
- Sentry.captureException(error);
+ 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>
diff --git a/libraries/react-shared-libraries/src/sentry/initialize.sentry.client.ts b/libraries/react-shared-libraries/src/sentry/initialize.sentry.client.ts
index 416a96efd..70e626d72 100644
--- a/libraries/react-shared-libraries/src/sentry/initialize.sentry.client.ts
+++ b/libraries/react-shared-libraries/src/sentry/initialize.sentry.client.ts
@@ -10,9 +10,11 @@ export const initializeSentryClient = (environment: string, dsn: string) =>
maskAllText: true,
maskAllInputs: true,
}),
+ Sentry.feedbackIntegration({
+ // Disable the injection of the default widget
+ autoInject: false,
+ }),
],
- replaysSessionSampleRate:
- environment === 'development' ? 1.0 : 0.1,
- replaysOnErrorSampleRate:
- environment === 'development' ? 1.0 : 0.1,
+ replaysSessionSampleRate: environment === 'development' ? 1.0 : 0.1,
+ replaysOnErrorSampleRate: environment === 'development' ? 1.0 : 0.1,
});