From c28021ec68b8b1f67929ef1ae2f512be835d72ea Mon Sep 17 00:00:00 2001 From: Robin Huang Date: Wed, 27 Nov 2024 19:02:28 -0800 Subject: [PATCH] Show preview of error in pop up. (#389) * Show preview of error in pop up. * Update message. --- src/services/sentry.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/services/sentry.ts b/src/services/sentry.ts index 9c666e50..47140a5a 100644 --- a/src/services/sentry.ts +++ b/src/services/sentry.ts @@ -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;