-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
fix/sentry crash modal #926
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 3 commits
06b309e
1862ebb
370fdbe
f76762b
ff39159
4e56391
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,19 @@ export const initializeSentryClient = (environment: string, dsn: string) => | |
autoInject: false, | ||
}), | ||
], | ||
beforeSend(event: Sentry.Event, hint: Sentry.EventHint) { | ||
// Check if it is an exception, and if so, show the report dialog | ||
if (event.exception && event.event_id) { | ||
try { | ||
Sentry.showReportDialog({ eventId: event.event_id }); | ||
} catch (err) { | ||
// Prevent error reporting from causing its own errors | ||
// Optionally log the error for debugging | ||
// console.error('Failed to show Sentry report dialog:', err); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. According to the project's Sentry logging guidelines, error logging should use Sentry's structured logger instead of console.error. Consider using Copilot generated this review using guidance from copilot-instructions.md. Positive FeedbackNegative Feedback |
||
} | ||
} | ||
return event; | ||
}, | ||
replaysSessionSampleRate: environment === 'development' ? 1.0 : 0.1, | ||
replaysOnErrorSampleRate: environment === 'development' ? 1.0 : 0.1, | ||
}); |
Uh oh!
There was an error while loading. Please reload this page.