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

enh: Ask user: Capture error in Sentry when app crashes #184

Merged
13 changes: 9 additions & 4 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,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
Loading