Skip to content

Commit

Permalink
Don't catch exceptions in backup/restore functions
Browse files Browse the repository at this point in the history
Don't catch exceptions that arise in the backup and restore functions,
otherwise GCP won't properly interpret them as errors.
  • Loading branch information
simenheg committed Apr 5, 2024
1 parent 5b3acb8 commit db3fc64
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 0 additions & 8 deletions functions/backupAndRestore.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }));
});
}

Expand Down Expand Up @@ -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 }));
});
}

0 comments on commit db3fc64

Please sign in to comment.