Skip to content

Commit

Permalink
fix: handle unhandled promise rejections by logging error messages in…
Browse files Browse the repository at this point in the history
… main rather than popup
🎲 committed Dec 17, 2024
1 parent ba625cb commit 1a48add
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/main/index.ts
Original file line number Diff line number Diff line change
@@ -54,7 +54,6 @@ process.on('uncaughtException', (err) => {

process.on('unhandledRejection', (err) => {
Logger.flush()
const recentLogs = fs.readFileSync(config.logfile, 'utf-8').split('\n').slice(-10)

const error = new Error(err as string)

@@ -63,7 +62,7 @@ process.on('unhandledRejection', (err) => {
message: error.message
})

showError(error, recentLogs)
Logger.error(`Unhandled Rejection: ${error.message}`, 'main')
})

if (config.aptabaseAppKey) {

0 comments on commit 1a48add

Please sign in to comment.