[Chore] Revert ErrorHandler changes for debugging
This commit is contained in:
parent
397985ebd7
commit
785bd0a672
2 changed files with 29 additions and 11 deletions
15
src/bootstrap.js
vendored
15
src/bootstrap.js
vendored
|
@ -1,4 +1,4 @@
|
|||
const { app, dialog } = require('electron');
|
||||
const { app } = require('electron');
|
||||
const { readFileSync } = require('fs');
|
||||
const { join } = require('path');
|
||||
|
||||
|
@ -14,15 +14,8 @@ global.releaseChannel = buildInfo.releaseChannel;
|
|||
|
||||
log('BuildInfo', buildInfo);
|
||||
|
||||
const fatal = e => {
|
||||
log('Fatal', e);
|
||||
|
||||
dialog.showMessageBox({
|
||||
type: 'error',
|
||||
message: 'A fatal Javascript error occured',
|
||||
detail: e?.stack ?? String(e)
|
||||
}).then(() => app.quit());
|
||||
};
|
||||
const { fatal, handled, init: EHInit } = require('./errorHandler');
|
||||
EHInit();
|
||||
|
||||
const splash = require('./splash');
|
||||
|
||||
|
@ -76,7 +69,7 @@ const startUpdate = async () => {
|
|||
inst.on('host-updated', () => autoStart.update(() => {}));
|
||||
inst.on('unhandled-exception', fatal);
|
||||
inst.on('InconsistentInstallerState', fatal);
|
||||
inst.on('update-error', console.error);
|
||||
inst.on('update-error', handled);
|
||||
|
||||
require('./firstRun').do(inst);
|
||||
} else {
|
||||
|
|
25
src/errorHandler.js
Normal file
25
src/errorHandler.js
Normal file
|
@ -0,0 +1,25 @@
|
|||
const { app, dialog } = require("electron");
|
||||
|
||||
exports.init = () => {
|
||||
process.on('uncaughtException', err => {
|
||||
const stack = err.stack ?? String(err);
|
||||
console.warn(stack);
|
||||
|
||||
// dialog.showErrorBox('A JavaScript error occurred in the main process', message);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
exports.fatal = (err) => {
|
||||
log('ErrorHandler', 'Fatal:', err);
|
||||
|
||||
dialog.showMessageBox(null, {
|
||||
type: 'error',
|
||||
message: 'A fatal Javascript error occured',
|
||||
detail: err?.stack ?? String(err)
|
||||
}).then(() => app.quit());
|
||||
};
|
||||
|
||||
exports.handled = (err) => {
|
||||
log('ErrorHandler', 'Handled:', err);
|
||||
};
|
Loading…
Reference in a new issue