Skip to content
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

Show preview of error in pop up. #389

Merged
merged 2 commits into from
Nov 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/services/sentry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,15 @@ class SentryLogging {
return event;
}

const errorMessage = event.exception?.values?.[0]?.value || 'Unknown error';
const errorType = event.exception?.values?.[0]?.type || 'Error';

const { response } = await dialog.showMessageBox({
title: 'Send Crash Statistics',
message: `Would you like to send crash statistics to the team?`,
buttons: ['Always send crash reports', 'Do not send crash report'],
title: 'Send Crash Report',
message: `An error occurred: ${errorType}`,
detail: `${errorMessage}\n\nWould you like to send the crash to the team?`,
buttons: ['Send Report', 'Do not send crash report'],
type: 'error',
});

return response === 0 ? event : null;
Expand Down
Loading