[Chore] Revert
This commit is contained in:
parent
9a97e2338f
commit
e7d1a6dfac
|
@ -14,8 +14,8 @@ global.releaseChannel = buildInfo.releaseChannel;
|
||||||
|
|
||||||
log('BuildInfo', buildInfo);
|
log('BuildInfo', buildInfo);
|
||||||
|
|
||||||
const { fatal } = require('./errorHandler');
|
const { fatal, handled, init: EHInit } = require('./errorHandler');
|
||||||
// process.on('uncaughtException', fatal);
|
EHInit();
|
||||||
|
|
||||||
const splash = require('./splash');
|
const splash = require('./splash');
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ const startUpdate = async () => {
|
||||||
inst.on('host-updated', () => autoStart.update(() => {}));
|
inst.on('host-updated', () => autoStart.update(() => {}));
|
||||||
inst.on('unhandled-exception', fatal);
|
inst.on('unhandled-exception', fatal);
|
||||||
inst.on('InconsistentInstallerState', fatal);
|
inst.on('InconsistentInstallerState', fatal);
|
||||||
inst.on('update-error', console.error);
|
inst.on('update-error', handled);
|
||||||
|
|
||||||
require('./firstRun').do(inst);
|
require('./firstRun').do(inst);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1,8 +1,25 @@
|
||||||
const { app, dialog } = require("electron");
|
const { app, dialog } = require("electron");
|
||||||
|
|
||||||
|
exports.init = () => {
|
||||||
|
process.on('uncaughtException', err => {
|
||||||
|
const stack = err.stack ?? String(err);
|
||||||
|
console.warn(stack);
|
||||||
|
|
||||||
exports.fatal = (e) => console.log(e) || dialog.showMessageBox({
|
// dialog.showErrorBox('A JavaScript error occurred in the main process', message);
|
||||||
type: 'error',
|
});
|
||||||
message: 'A fatal Javascript error occured',
|
};
|
||||||
detail: e?.stack ?? String(e)
|
|
||||||
}).then(() => app.quit());
|
|
||||||
|
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 New Issue