From db3fc64906a17592f6f205c1e3021d1b45012812 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simen=20Heggest=C3=B8yl?= Date: Fri, 23 Feb 2024 13:08:35 +0100 Subject: [PATCH] Don't catch exceptions in backup/restore functions Don't catch exceptions that arise in the backup and restore functions, otherwise GCP won't properly interpret them as errors. --- CHANGELOG.md | 4 ++++ functions/backupAndRestore.js | 8 -------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c6d6a6b58..e286af566 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format ## [UNRELEASED] +### Fixed + +- Improved error reporting from backup and restore Cloud Functions. + ### Security - Updated dependencies. diff --git a/functions/backupAndRestore.js b/functions/backupAndRestore.js index 8d0ebcbcd..b54153c90 100644 --- a/functions/backupAndRestore.js +++ b/functions/backupAndRestore.js @@ -45,10 +45,6 @@ async function restoreBackup() { .then(() => { console.log(`Backup restored from folder ${backupRoute}`); return Promise.resolve(); - }) - .catch(async (error) => { - console.error('Error message: ', error.message); - return Promise.reject(new Error({ message: error.message })); }); } @@ -78,9 +74,5 @@ async function generateBackup() { .then(() => { console.log(`Backup saved to folder on ${backupRoute}`); return Promise.resolve(); - }) - .catch(async (error) => { - console.error('Error message: ', error.message); - return Promise.reject(new Error({ message: error.message })); }); }