Merge pull request #13109 from Thoro/fix-encrypt-error-message

Add error log in case encryption on config save fails
This commit is contained in:
stonezdj(Daojun Zhang) 2020-09-23 14:03:20 +08:00 committed by GitHub
commit 20d4e86e0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -72,6 +72,8 @@ func (d *Database) Save(cfgs map[string]interface{}) error {
if _, ok := item.ItemType.(*metadata.PasswordType); ok {
if encryptPassword, err := encrypt.Instance().Encrypt(strValue); err == nil {
entry.Value = encryptPassword
} else {
log.Errorf("encrypt password failed, error: %v", err)
}
}
configEntries = append(configEntries, *entry)