Skip to content

Commit

Permalink
Merge pull request #961 from oslokommune/backup-and-restore-dont-catc…
Browse files Browse the repository at this point in the history
…h-errors

Don't catch exceptions in backup/restore functions
  • Loading branch information
simenheg authored Apr 5, 2024
2 parents 5b3acb8 + db3fc64 commit eff7d74
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 eff7d74

Please sign in to comment.