mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-17 05:58:41 -09:00
auto-updater: clean up error handling
This commit is contained in:
parent
461f7d9430
commit
a5b805cf66
1 changed files with 5 additions and 10 deletions
|
|
@ -6,8 +6,11 @@ const FEED_URL = 'https://nuts-serve-nxchetcjig.now.sh/update/osx';
|
||||||
|
|
||||||
module.exports = function AutoUpdater (rpc) {
|
module.exports = function AutoUpdater (rpc) {
|
||||||
autoUpdater.on('error', (err, msg) => {
|
autoUpdater.on('error', (err, msg) => {
|
||||||
dialog.showMessageBox({title: 'title', message: JSON.stringify(err), buttons: ['Ok error']});
|
dialog.showMessageBox({
|
||||||
dialog.showMessageBox({title: 'title', message: JSON.stringify(msg), buttons: ['Ok error']});
|
title: 'title',
|
||||||
|
message: 'Auto updater error: ' + msg + ' (' + err.stack + ')',
|
||||||
|
buttons: ['Ok']
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
autoUpdater.setFeedURL(`${FEED_URL}/${version}`);
|
autoUpdater.setFeedURL(`${FEED_URL}/${version}`);
|
||||||
|
|
@ -16,14 +19,6 @@ module.exports = function AutoUpdater (rpc) {
|
||||||
rpc.emit('update-available');
|
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', () => {
|
rpc.once('quit-and-install', () => {
|
||||||
autoUpdater.quitAndInstall();
|
autoUpdater.quitAndInstall();
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue