Add error log in case encryption on config save fails

Signed-off-by: Thomas Rosenstein <thomas.rosenstein@creamfinance.com>
This commit is contained in:
Thomas Rosenstein 2020-09-20 22:29:47 +02:00
parent b9bb47ca80
commit 452a0c9c45

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)