From a5b805cf6623442642c8e5389f83b3468fdc1062 Mon Sep 17 00:00:00 2001 From: Guillermo Rauch Date: Wed, 6 Jul 2016 21:42:30 -0700 Subject: [PATCH] auto-updater: clean up error handling --- auto-updater.js | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/auto-updater.js b/auto-updater.js index 3d3c12b6..ef16ee8d 100644 --- a/auto-updater.js +++ b/auto-updater.js @@ -6,8 +6,11 @@ const FEED_URL = 'https://nuts-serve-nxchetcjig.now.sh/update/osx'; module.exports = function AutoUpdater (rpc) { autoUpdater.on('error', (err, msg) => { - dialog.showMessageBox({title: 'title', message: JSON.stringify(err), buttons: ['Ok error']}); - dialog.showMessageBox({title: 'title', message: JSON.stringify(msg), buttons: ['Ok error']}); + dialog.showMessageBox({ + title: 'title', + message: 'Auto updater error: ' + msg + ' (' + err.stack + ')', + buttons: ['Ok'] + }); }); autoUpdater.setFeedURL(`${FEED_URL}/${version}`); @@ -16,14 +19,6 @@ module.exports = function AutoUpdater (rpc) { rpc.emit('update-available'); }); - autoUpdater.once('update-available', () => { - dialog.showMessageBox({title: 'title', message: 'update-available', buttons: ['Ok']}); - }); - - autoUpdater.once('update-not-available', () => { - dialog.showMessageBox({title: 'title', message: 'update-not-available', buttons: ['Ok']}); - }); - rpc.once('quit-and-install', () => { autoUpdater.quitAndInstall(); });