From e5239d952e75f1d126fd3c457e10beb69bdb35f5 Mon Sep 17 00:00:00 2001 From: Jiiks Date: Thu, 7 Mar 2019 14:15:24 +0200 Subject: [PATCH] Send error event --- core/src/modules/updater.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/src/modules/updater.js b/core/src/modules/updater.js index 891e0218..93ce1db3 100644 --- a/core/src/modules/updater.js +++ b/core/src/modules/updater.js @@ -85,12 +85,12 @@ export default class Updater extends Module { try { console.log('[BetterDiscord:Updater] Updating', update.id); await this.downloadTarGz(`https://github.com/JsSucks/BetterDiscordApp${update.remote}`, this.bd.config.getPath(update.id)); - console.log('[BetterDiscord:Updater] Finished updating', update.id); - this.bd.sendToDiscord('updater-updateFinished', update); this.updateFinished(update); } catch (err) { console.log('[BetterDiscord:Updater] Failed to update', update.id); console.log(err); + update.error = err; + this.bd.sendToDiscord('updater-updateError', update); } } @@ -116,6 +116,9 @@ export default class Updater extends Module { if (update.id === 'core') this.restartRequired = true; if (update.id === 'client') this.reloadRequired = true; + console.log('[BetterDiscord:Updater] Finished updating', update.id); + this.bd.sendToDiscord('updater-updateFinished', update); + this.finishedUpdates++; if (this.finishedUpdates >= this.totalUpdates) { this.bd.sendToDiscord('updater-updated', { restartRequired: this.restartRequired, reloadRequired: this.reloadRequired });