From 6907e3e95693711fd19397ca7ff907e1deeb0a4a Mon Sep 17 00:00:00 2001 From: Robin Huang Date: Wed, 27 Nov 2024 16:22:57 -0800 Subject: [PATCH 1/2] Show preview of error in pop up. --- 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..d1c7cccf 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 report to the team?`, + buttons: ['Send Report', 'Do not send crash report'], + type: 'error', }); return response === 0 ? event : null; From 9126174b3a5cea56dfc4ede3c2cb7f29b72635e3 Mon Sep 17 00:00:00 2001 From: Robin Huang Date: Wed, 27 Nov 2024 16:26:59 -0800 Subject: [PATCH 2/2] Update message. --- src/services/sentry.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/sentry.ts b/src/services/sentry.ts index d1c7cccf..47140a5a 100644 --- a/src/services/sentry.ts +++ b/src/services/sentry.ts @@ -27,7 +27,7 @@ class SentryLogging { const { response } = await dialog.showMessageBox({ title: 'Send Crash Report', message: `An error occurred: ${errorType}`, - detail: `${errorMessage}\n\nWould you like to send the crash report to the team?`, + detail: `${errorMessage}\n\nWould you like to send the crash to the team?`, buttons: ['Send Report', 'Do not send crash report'], type: 'error', });