console: hook stacktrace to uiConsole directly
This commit is contained in:
parent
e9607aad77
commit
53c32420d1
2 changed files with 4 additions and 10 deletions
|
|
@ -1,5 +1,6 @@
|
|||
var StackTrace = require('stacktrace-js'),
|
||||
ipc = require('./ipc')
|
||||
ipc = require('./ipc'),
|
||||
uiConsole = require('./ui/ui-console')
|
||||
|
||||
window.onerror = function(msg,url,row,col, error) {
|
||||
|
||||
|
|
@ -17,12 +18,12 @@ window.onerror = function(msg,url,row,col, error) {
|
|||
|
||||
}).join('\n')
|
||||
|
||||
console.error(`${msg}\n${stringifiedStack}`)
|
||||
uiConsole.log('error', `${msg}\n${stringifiedStack}`)
|
||||
ipc.send('errorLog', `(ERROR, CLIENT) ${msg}\n${stringifiedStack}`)
|
||||
|
||||
}).catch(()=>{
|
||||
|
||||
console.error(`${msg}\n at ${url}:${row}:${col}\n (no stacktrace available)`)
|
||||
uiConsole.log('error', `${msg}\n at ${url}:${row}:${col}\n (no stacktrace available)`)
|
||||
ipc.send('errorLog', `(ERROR, CLIENT) ${msg}\n at ${url}:${row}:${col}\n (no stacktrace available)`)
|
||||
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue