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

@@ -403,9 +403,8 @@ async function setBackupConfig(backupConfig) {
}
}
const backupsTestConfigAsync = util.promisify(backups.testConfig);
await backupsTestConfigAsync(backupConfig);
const error = await backups.testConfig(backupConfig);
if (error) throw error;
if ('password' in backupConfig) { // user set password
backupConfig.encryption = backups.generateEncryptionKeysSync(backupConfig.password);