main: make error logging work in both node and electron env
This commit is contained in:
parent
ebf3ba0eb2
commit
5355487927
2 changed files with 13 additions and 7 deletions
|
|
@ -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')
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue