mirror of https://github.com/GooseMod/OpenAsar
[Bootstrap] Integrate ErrorHandler
parent
e7d1a6dfac
commit
af9cf611cb
@ -1,25 +0,0 @@
|
||||
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 new issue