[ErrorHandler] Add uncaught exception handling
This commit is contained in:
parent
d53177898a
commit
a8c0a15792
2 changed files with 9 additions and 6 deletions
3
src/bootstrap.js
vendored
3
src/bootstrap.js
vendored
|
@ -15,6 +15,9 @@ global.releaseChannel = buildInfo.releaseChannel;
|
|||
|
||||
log('BuildInfo', 'Loaded build info', buildInfo);
|
||||
|
||||
const errorHandler = require('./errorHandler');
|
||||
errorHandler.init();
|
||||
|
||||
// Just required for startup
|
||||
const appSettings = require('./appSettings');
|
||||
const GPUSettings = require('./GPUSettings');
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
const { app } = require("electron");
|
||||
|
||||
exports.init = () => {
|
||||
/* process.on('uncaughtException', error => {
|
||||
process.on('uncaughtException', error => {
|
||||
const stack = error.stack ? error.stack : String(error);
|
||||
const message = `Uncaught exception:\n ${stack}`;
|
||||
const message = `Uncaught exception:\n${stack}`;
|
||||
console.warn(message);
|
||||
|
||||
if (!isErrorSafeToSuppress(error)) {
|
||||
_electron.dialog.showErrorBox('A JavaScript error occurred in the main process', message);
|
||||
}
|
||||
}); */
|
||||
// _electron.dialog.showErrorBox('A JavaScript error occurred in the main process', message);
|
||||
});
|
||||
|
||||
log('ErrorHandler', 'Inited');
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue