Skip to content

Commit 1ed76af

Browse files
authored
Merge pull request #9442 from ellemouton/miscErrorFormats
misc: fix incorrect inclusion of nil err in various formatted strings
2 parents c3cbfd8 + e3b94e4 commit 1ed76af

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

lnrpc/routerrpc/router_server.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1343,12 +1343,17 @@ func (s *Server) trackPayment(subscription routing.ControlTowerSubscriber,
13431343
err := s.trackPaymentStream(
13441344
stream.Context(), subscription, noInflightUpdates, stream.Send,
13451345
)
1346+
switch {
1347+
case err == nil:
1348+
return nil
13461349

13471350
// If the context is canceled, we don't return an error.
1348-
if errors.Is(err, context.Canceled) {
1351+
case errors.Is(err, context.Canceled):
13491352
log.Infof("Payment stream %v canceled", identifier)
13501353

13511354
return nil
1355+
1356+
default:
13521357
}
13531358

13541359
// Otherwise, we will log and return the error as the stream has

lntest/harness_assertion.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1862,13 +1862,11 @@ func (h *HarnessTest) AssertChannelInGraphDB(hn *node.HarnessNode,
18621862
// Make sure the policies are populated, otherwise this edge
18631863
// cannot be used for routing.
18641864
if resp.Node1Policy == nil {
1865-
return fmt.Errorf("channel %s has no policy1: %w",
1866-
op, err)
1865+
return fmt.Errorf("channel %s has no policy1", op)
18671866
}
18681867

18691868
if resp.Node2Policy == nil {
1870-
return fmt.Errorf("channel %s has no policy2: %w",
1871-
op, err)
1869+
return fmt.Errorf("channel %s has no policy2", op)
18721870
}
18731871

18741872
edge = resp

0 commit comments

Comments
 (0)