backups: make test config funcs return error

This commit is contained in:
Girish Ramakrishnan
2021-09-17 10:11:28 -07:00
parent 2554c47632
commit e8aaad976b
4 changed files with 28 additions and 27 deletions

View File

@@ -1780,10 +1780,11 @@ async function importApp(app, data, auditSource) {
error = checkAppState(app, exports.ISTATE_PENDING_IMPORT);
if (error) throw error;
const testProviderConfig = util.promisify(backups.testProviderConfig);
// TODO: make this smarter to do a read-only test and check if the file exists in the storage backend
if (backupConfig) await testProviderConfig(backupConfig);
if (backupConfig) {
error = await backups.testProviderConfig(backupConfig);
if (error) throw error;
}
if (backupConfig) {
if ('password' in backupConfig) {