Commit b2f42cdc authored by Sietse Ringers's avatar Sietse Ringers
Browse files

Also store info on failed updates

parent dde1fabc
......@@ -166,15 +166,17 @@ func (cm *CredentialManager) update() error {
// Perform all new updates
for i := len(cm.updates); i < len(credentialManagerUpdates); i++ {
if err := credentialManagerUpdates[i](cm); err != nil {
return err
err = credentialManagerUpdates[i](cm)
update := update{
When: Timestamp(time.Now()),
Number: i,
Success: err == nil,
}
if err != nil {
str := err.Error()
update.Error = &str
}
cm.updates = append(cm.updates,
update{
When: Timestamp(time.Now()),
Number: i,
},
)
cm.updates = append(cm.updates, update)
}
// Save updates file
......
......@@ -12,8 +12,10 @@ import (
)
type update struct {
When Timestamp
Number int
When Timestamp
Number int
Success bool
Error *string
}
var credentialManagerUpdates = []func(manager *CredentialManager) error{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment