diff --git a/app/main/electron-app.js b/app/main/electron-app.js index 6ff88746..5486fa82 100644 --- a/app/main/electron-app.js +++ b/app/main/electron-app.js @@ -1,11 +1,6 @@ -var {app, dialog, Tray, Menu} = require('electron'), +var {app, Menu} = require('electron'), settings = require('./settings'), - path = require('path'), - tray - -dialog.showErrorBox = function(title,err) { - console.log(title + ': ' + err) -} + path = require('path') app.commandLine.appendSwitch('--touch-events') diff --git a/app/main/main.js b/app/main/main.js index d6ec8bfc..704eaa6d 100644 --- a/app/main/main.js +++ b/app/main/main.js @@ -40,6 +40,17 @@ var start = function(readyApp) { } } + try { + require('electron').dialog.showErrorBox = (title, err)=>{ + console.error(title + ': ' + err) + } + } catch(e){ + process.on('uncaughtException', (err)=>{ + console.error('A JavaScript error occurred in the main process:') + console.trace(err) + }) + } + }