diff --git a/main/index.ts b/main/index.ts index f1da477..787edb4 100644 --- a/main/index.ts +++ b/main/index.ts @@ -1,4 +1,4 @@ -import {app} from 'electron'; +import {app, dialog} from 'electron'; import log from './log'; import startApp from './app'; import loadConfig from './config'; @@ -10,7 +10,17 @@ app.removeAllListeners(); const appReady = new Promise(resolve => app.once('ready', resolve)); process.on('unhandledRejection', (reason: string) => { - log.error('FATAL: Unhandled rejection! Reason:', reason); + const msg = 'FATAL: Unhandled rejection! Reason: ' + reason + appReady.then(() => { + dialog.showMessageBox({ + type: 'error', + buttons: ['OK'], + message: msg, + }, () => { + qpp.quit(); + }) + }); + log.error(msg); }); app.on('will-quit', () => {