auto-updater: clean up error handling

This commit is contained in:
Guillermo Rauch 2016-07-06 21:42:30 -07:00
parent 461f7d9430
commit a5b805cf66

View file

@ -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();
});