Skip to content

Commit

Permalink
print unhandled rejections to console when debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
cenkalti committed Sep 14, 2020
1 parent 5db5a73 commit 202b919
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ const sentryDsn = process.env.ELECTRON_WEBPACK_APP_SENTRY_DSN
if (sentryDsn) {
log.info('Initializing Sentry')
Sentry.init({ dsn: sentryDsn, debug: !isProduction })
} else {
// Hooking to unhandledRejection event prevents Sentry from collecting them.
// Maybe this is a bug or I didn't understand how it works :(
process.on('unhandledRejection', (reason, promise) => {
console.log('Unhandled Rejection at:', promise, 'reason:', reason)
})
}

async function quitApp () {
Expand Down

0 comments on commit 202b919

Please sign in to comment.