Skip to content

Commit

Permalink
Show preview of error in pop up. (#389)
Browse files Browse the repository at this point in the history
* Show preview of error in pop up.

* Update message.
  • Loading branch information
robinjhuang authored Nov 28, 2024
1 parent 7749dc0 commit c28021e
Showing 1 changed file with 8 additions and 3 deletions.
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

0 comments on commit c28021e

Please sign in to comment.