Handle uncaught errors

This commit is contained in:
TC
2021-02-24 20:53:41 +01:00
parent 5a1358b310
commit 5842a6d42f
3 changed files with 38 additions and 2 deletions

View File

@ -3,6 +3,7 @@ const path = require("path");
const electron = require("electron");
const is = require("electron-is");
const unhandled = require("electron-unhandled");
const { autoUpdater } = require("electron-updater");
const config = require("./config");
@ -11,6 +12,12 @@ const { fileExists, injectCSS } = require("./plugins/utils");
const { isTesting } = require("./utils/testing");
const { setUpTray } = require("./tray");
// Catch errors and log them
unhandled({
logger: console.error,
showDialog: false,
});
const app = electron.app;
app.commandLine.appendSwitch(
"js-flags",