multi: fix fmt.Errorf error wrapping

Refactor fmt.Errorf usage to correctly wrap errors instead of using
non-wrapping format verbs.
This commit is contained in:
ffranr committed 2024-02-27 11:13:40 +00:00
1 parent 581c16d72f
commit cd566eb097
103 files changed
+426 -390

No files matched your search

+4 -4
View File
@@ -263,7 +263,7 @@ func (db *DB) GetBackends(ctx context.Context, chanDBPath,
db.Etcd.CloneWithSubNamespace(NSChannelDB),
)
if err != nil {
return nil, fmt.Errorf("error opening etcd DB: %v", err)
return nil, fmt.Errorf("error opening etcd DB: %w", err)
}
closeFuncs[NSChannelDB] = etcdBackend.Close
@@ -545,7 +545,7 @@ func (db *DB) GetBackends(ctx context.Context, chanDBPath,
AutoCompactMinAge: db.Bolt.AutoCompactMinAge,
})
if err != nil {
return nil, fmt.Errorf("error opening bolt DB: %v", err)
return nil, fmt.Errorf("error opening bolt DB: %w", err)
}
closeFuncs[NSChannelDB] = boltBackend.Close
@@ -558,7 +558,7 @@ func (db *DB) GetBackends(ctx context.Context, chanDBPath,
AutoCompactMinAge: db.Bolt.AutoCompactMinAge,
})
if err != nil {
return nil, fmt.Errorf("error opening macaroon DB: %v", err)
return nil, fmt.Errorf("error opening macaroon DB: %w", err)
}
closeFuncs[NSMacaroonDB] = macaroonBackend.Close
@@ -571,7 +571,7 @@ func (db *DB) GetBackends(ctx context.Context, chanDBPath,
AutoCompactMinAge: db.Bolt.AutoCompactMinAge,
})
if err != nil {
return nil, fmt.Errorf("error opening decayed log DB: %v", err)
return nil, fmt.Errorf("error opening decayed log DB: %w", err)
}
closeFuncs[NSDecayedLogDB] = decayedLogBackend.Close