Skip to content

Commit

Permalink
fix(btcdctrl): handle timeout cases separately
Browse files Browse the repository at this point in the history
the client could exist but with an error case, this should be handled.
  • Loading branch information
linden committed Oct 9, 2024
1 parent 7d60491 commit d5cf8f4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions btcdctrl/btcdctrl.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,13 +356,13 @@ func (c *Controller) Start() error {
break
}

// Check if the connection loop exited with an error.
if err != nil {
return errors.Join(errors.New("timeout"), err)

Check failure on line 361 in btcdctrl/btcdctrl.go

View workflow job for this annotation

GitHub Actions / Unit race

undefined: errors.Join
}

// Check if the client was created.
if c.Client == nil {
// Check if the connection loop exited with an error.
if err != nil {
return errors.Join(errors.New("timeout"), err)
}

return errors.New("timeout")
}

Expand Down

0 comments on commit d5cf8f4

Please sign in to comment.