2018-03-06 17:05:53 +00:00
|
|
|
const addUnhandledErrorHandler = require('electron-unhandled');
|
|
|
|
|
|
|
|
const Errors = require('./types/errors');
|
|
|
|
|
|
|
|
|
2018-03-06 17:10:35 +00:00
|
|
|
// addHandler :: Unit -> Unit
|
|
|
|
exports.addHandler = () => {
|
2018-03-06 17:05:53 +00:00
|
|
|
addUnhandledErrorHandler({
|
|
|
|
logger: (error) => {
|
|
|
|
console.error(
|
|
|
|
'Uncaught error or unhandled promise rejection:',
|
|
|
|
Errors.toLogFormat(error)
|
|
|
|
);
|
|
|
|
},
|
|
|
|
showDialog: false,
|
|
|
|
});
|
|
|
|
};
|