From d1e31d2472cf54f162d9e07f523dc741d2d5f1c8 Mon Sep 17 00:00:00 2001 From: SebClem Date: Sat, 30 Apr 2022 16:08:56 +0200 Subject: [PATCH] :hammer: Catch some errors --- .../rootfs/opt/nextcloud_backup/routes/api.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/nextcloud_backup/rootfs/opt/nextcloud_backup/routes/api.js b/nextcloud_backup/rootfs/opt/nextcloud_backup/routes/api.js index 4b86eb5..d08ea77 100644 --- a/nextcloud_backup/rootfs/opt/nextcloud_backup/routes/api.js +++ b/nextcloud_backup/rootfs/opt/nextcloud_backup/routes/api.js @@ -128,9 +128,15 @@ router.post("/manual-backup", function (req, res, next) { hassioApiTools .downloadSnapshot(id) .then(() => { - webdav.uploadFile(id, webdav.getConf().back_dir + pathTools.manual + name + ".tar").catch(); - res.status(201); - res.send(); + webdav.uploadFile(id, webdav.getConf().back_dir + pathTools.manual + name + ".tar").then(()=>{ + res.status(201); + res.send(); + }).catch(()=>{ + res.status(500); + res.send(); + } + ); + }) .catch(() => { res.status(500); @@ -159,10 +165,10 @@ router.post("/new-backup", function (req, res, next) { .then(() => { hassioApiTools.startAddons().catch(() => { }) - }); + }).catch(()=>{}); }).catch(()=>{}); }).catch(()=>{}); - }).catch(()=>{});; + }).catch(()=>{}); }) .catch(() => { hassioApiTools.startAddons().catch(() => {