Skip to content

Commit

Permalink
enh: Ask user: Capture error in Sentry when app crashes (#184)
Browse files Browse the repository at this point in the history
* enh: Ask user: Capture error in Sentry when app crashes

* Reverting testing changes

* Small update

* Removing saving portion of settings

* Reverting UI change

* Reverting changes

* Reverting UI change

---------

Co-authored-by: Oto Ciulis <[email protected]>
  • Loading branch information
oto-ciulis-tt and otociulis authored Nov 8, 2024
1 parent f6dbbb5 commit bcf2877
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,18 @@ if (!gotTheLock) {
Sentry.init({
dsn: SENTRY_URL_ENDPOINT,
autoSessionTracking: false,
beforeSend(event, hint) {
if (event.extra?.comfyUIExecutionError) {
async beforeSend(event, hint) {
if (event.extra?.comfyUIExecutionError || comfySettings.sendCrashStatistics) {
return event;
}

//TODO (use default pop up behavior).
return event;
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'],
});

return response === 0 ? event : null;
},
integrations: [
Sentry.childProcessIntegration({
Expand Down

0 comments on commit bcf2877

Please sign in to comment.