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

+2 -2
View File
@@ -226,7 +226,7 @@ func (s *SubSwapper) updateBackupFile(closedChans ...wire.OutPoint) error {
var b bytes.Buffer
err = newMulti.PackToWriter(&b, s.keyRing)
if err != nil {
return fmt.Errorf("unable to pack multi backup: %v", err)
return fmt.Errorf("unable to pack multi backup: %w", err)
}
// Finally, we'll swap out the old backup for this new one in a single
@@ -234,7 +234,7 @@ func (s *SubSwapper) updateBackupFile(closedChans ...wire.OutPoint) error {
// channels.
err = s.Swapper.UpdateAndSwap(PackedMulti(b.Bytes()))
if err != nil {
return fmt.Errorf("unable to update multi backup: %v", err)
return fmt.Errorf("unable to update multi backup: %w", err)
}
return nil