From 084af91620025f3b72528461e3173c90f019a3bc Mon Sep 17 00:00:00 2001 From: SebClem Date: Sat, 30 Apr 2022 15:19:16 +0200 Subject: [PATCH] :ambulance: Fix crash on backup upload to ha --- .../rootfs/opt/nextcloud_backup/tools/hassioApiTools.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/nextcloud_backup/rootfs/opt/nextcloud_backup/tools/hassioApiTools.js b/nextcloud_backup/rootfs/opt/nextcloud_backup/tools/hassioApiTools.js index 7738288..fbe6a36 100644 --- a/nextcloud_backup/rootfs/opt/nextcloud_backup/tools/hassioApiTools.js +++ b/nextcloud_backup/rootfs/opt/nextcloud_backup/tools/hassioApiTools.js @@ -189,20 +189,20 @@ function downloadSnapshot(id) { }), stream ) - .then((res) => { + .then(() => { logger.info("Download success !"); status.progress = 1; statusTools.setStatus(status); logger.debug("Snapshot dl size : " + fs.statSync(tmp_file).size / 1024 / 1024); resolve(); }) - .catch((err) => { + .catch((error) => { fs.unlinkSync(tmp_file); statusTools.setError(`Fail to download Hassio backup (${error.message})`, 7); reject(`Fail to download Hassio backup (${error.message})`); }); }) - .catch((err) => { + .catch(() => { statusTools.setError("Fail to download Hassio backup. Not found ?", 7); reject(); }); @@ -213,7 +213,6 @@ function dellSnap(id) { return new Promise((resolve, reject) => { checkSnap(id) .then(() => { - let option = { headers: { "Authorization": `Bearer ${token}` }, responseType: "json", @@ -332,8 +331,6 @@ function uploadSnapshot(path) { let options = { body: form, - username: this.username, - password: this.password, headers: { "Authorization": `Bearer ${token}` }, };