Extract `Errors.addGlobalHandler` procedure
parent
be3e4d86c2
commit
2575196617
@ -0,0 +1,17 @@
|
|||||||
|
const addUnhandledErrorHandler = require('electron-unhandled');
|
||||||
|
|
||||||
|
const Errors = require('./types/errors');
|
||||||
|
|
||||||
|
|
||||||
|
// addGlobalHandler :: Unit -> Unit
|
||||||
|
exports.addGlobalHandler = () => {
|
||||||
|
addUnhandledErrorHandler({
|
||||||
|
logger: (error) => {
|
||||||
|
console.error(
|
||||||
|
'Uncaught error or unhandled promise rejection:',
|
||||||
|
Errors.toLogFormat(error)
|
||||||
|
);
|
||||||
|
},
|
||||||
|
showDialog: false,
|
||||||
|
});
|
||||||
|
};
|
||||||
Loading…
Reference in New Issue