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
@@ -1659,7 +1659,7 @@ func (d *AuthenticatedGossiper) retransmitStaleAnns(now time.Time) error {
chanToUpdate.info, chanToUpdate.edge,
)
if err != nil {
return fmt.Errorf("unable to update channel: %v", err)
return fmt.Errorf("unable to update channel: %w", err)
}
// If we have a valid announcement to transmit, then we'll send
@@ -1715,7 +1715,7 @@ func (d *AuthenticatedGossiper) retransmitStaleAnns(now time.Time) error {
// With all the wire announcements properly crafted, we'll broadcast
// our known outgoing channels to all our immediate peers.
if err := d.cfg.Broadcast(nil, signedUpdates...); err != nil {
return fmt.Errorf("unable to re-broadcast channels: %v", err)
return fmt.Errorf("unable to re-broadcast channels: %w", err)
}
return nil
+1 -1
View File
@@ -806,7 +806,7 @@ func createTestCtx(t *testing.T, startHeight uint32) (*testCtx, error) {
}, selfKeyDesc)
if err := gossiper.Start(); err != nil {
return nil, fmt.Errorf("unable to start router: %v", err)
return nil, fmt.Errorf("unable to start router: %w", err)
}
// Mark the graph as synced in order to allow the announcements to be
+3 -2
View File
@@ -904,7 +904,7 @@ func (g *GossipSyncer) processChanRangeReply(msg *lnwire.ReplyChannelRange) erro
g.cfg.isStillZombieChannel,
)
if err != nil {
return fmt.Errorf("unable to filter chan ids: %v", err)
return fmt.Errorf("unable to filter chan ids: %w", err)
}
// As we've received the entirety of the reply, we no longer need to
@@ -1599,7 +1599,8 @@ func (g *GossipSyncer) handleSyncTransition(req *syncTransitionReq) error {
err := g.sendGossipTimestampRange(firstTimestamp, timestampRange)
if err != nil {
return fmt.Errorf("unable to send local update horizon: %v", err)
return fmt.Errorf("unable to send local update horizon: %w",
err)
}
g.setSyncType(req.newSyncType)
+2 -1
View File
@@ -1045,7 +1045,8 @@ func TestGossipSyncerReplyChanRangeQueryBlockRange(t *testing.T) {
go func() {
for _, query := range queryReqs {
if err := syncer.replyChanRangeQuery(query); err != nil {
errCh <- fmt.Errorf("unable to issue query: %v", err)
errCh <- fmt.Errorf("unable to issue query: %w",
err)
return
}
}