Skip to content
This repository has been archived by the owner on Sep 6, 2023. It is now read-only.

Commit

Permalink
Fix auto update error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
jwheare committed May 24, 2019
1 parent 6abfedb commit 6651632
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions app/auto_update.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,9 @@ module.exports = {
autoUpdater.allowPrerelease = true;
autoUpdater.fullChangelog = true;

try {
autoUpdater.checkForUpdates();
} catch (exc) {
// This will error if running with code signing
}
autoUpdater.checkForUpdates().catch(function (exc) {
// pass
});

autoUpdater.on('error', function (error, errorMessage) {
setUpdateCheckMenuEnabled(menu, true);
Expand All @@ -66,7 +64,9 @@ module.exports = {
check: function () {
if (autoUpdater) {
// TODO show progress dialog
autoUpdater.checkForUpdates();
autoUpdater.checkForUpdates().catch(function (exc) {
// pass
});
autoUpdater.once('error', onUpdateError);
autoUpdater.once('update-downloaded', onUpdateDownloaded);
autoUpdater.once('update-not-available', onUpdateNotAvailable);
Expand Down Expand Up @@ -149,7 +149,6 @@ function onUpdateNotAvailable (event) {
autoUpdater.removeListener('update-downloaded', onUpdateDownloaded);
}
function onUpdateError (error, errorMessage) {
log.error('updateError', errorMessage, error);
dialog.showMessageBox({
type: 'error',
message: 'Error checking for updates',
Expand Down

0 comments on commit 6651632

Please sign in to comment.