From 252cbc7f90fcaa7ca55f10e6071f232c47267a6b Mon Sep 17 00:00:00 2001 From: Arthur Araujo <37311270+araujoarthur0@users.noreply.github.com> Date: Fri, 19 Jun 2020 14:59:21 -0300 Subject: [PATCH] Fix #258: Fixing crash when changing network while opening TTL (#267) --- changelog.txt | 1 + main.js | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/changelog.txt b/changelog.txt index e8da68a45..df6291106 100644 --- a/changelog.txt +++ b/changelog.txt @@ -15,6 +15,7 @@ - Fix: [#250] Silently ignoring waiver on non-working day or non-working day range - Fix: [#252] Prevent multiple preferences and workday waiver windows to be opened - Fix: [#255] Avoiding issue when closing preferences window without changing anything +- Fix: [#258] Fixing crash when changing network while opening TTL - Enhancement: [#228] Improved performance of TTL - Now moving through the calendar is much faster - Enhancement: [#152] Adding a "Copy" option in the "About message", making it easier to copy information when opening an issue - Enhancement: [#241] Changing input format for notification interval and hours per day on preferences diff --git a/main.js b/main.js index 63c27c376..f46ffad1f 100644 --- a/main.js +++ b/main.js @@ -39,6 +39,14 @@ var launchDate = new Date(); var recommendPunchIn = false; setTimeout(() => { recommendPunchIn = true; }, 30 * 60 * 1000); +process.on('uncaughtException', function(err) { + if (!err.message.includes('net::ERR_NETWORK_CHANGED')) { + console.error((new Date).toUTCString() + ' uncaughtException:', err.message); + console.error(err.stack); + process.exit(1); + } +}); + function checkIdleAndNotify() { if (recommendPunchIn) { recommendPunchIn = false;