Skip to content

Commit

Permalink
clarify errors
Browse files Browse the repository at this point in the history
  • Loading branch information
h5law committed Jul 27, 2023
1 parent 870805f commit 64ec990
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions p2p/debug/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ func PrintPeerList(bus modules.Bus, routerType RouterType) error {
// if !isStaked ...
pstore, err := pstoreProvider.GetStakedPeerstoreAtCurrentHeight()
if err != nil {
return fmt.Errorf("getting unstaked peerstore: %v", err)
return fmt.Errorf("error getting staked peerstore: %v", err)
}

peers = pstore.GetPeerList()
case UnstakedRouterType:
pstore, err := pstoreProvider.GetUnstakedPeerstore()
if err != nil {
return fmt.Errorf("getting unstaked peerstore: %v", err)
return fmt.Errorf("error getting unstaked peerstore: %v", err)
}

peers = pstore.GetPeerList()
Expand All @@ -52,11 +52,11 @@ func PrintPeerList(bus modules.Bus, routerType RouterType) error {
// if !isStaked ...
stakedPStore, err := pstoreProvider.GetStakedPeerstoreAtCurrentHeight()
if err != nil {
return fmt.Errorf("getting unstaked peerstore: %v", err)
return fmt.Errorf("error getting staked peerstore: %v", err)
}
unstakedPStore, err := pstoreProvider.GetUnstakedPeerstore()
if err != nil {
return fmt.Errorf("getting unstaked peerstore: %v", err)
return fmt.Errorf("error getting unstaked peerstore: %v", err)
}

unstakedPeers := unstakedPStore.GetPeerList()
Expand Down Expand Up @@ -113,7 +113,7 @@ func peerListRowConsumerFactory(peers types.PeerList) utils.RowConsumer {
for _, peer := range peers {
libp2pAddrInfo, err := utils.Libp2pAddrInfoFromPeer(peer)
if err != nil {
return fmt.Errorf("converting peer to libp2p addr info: %w", err)
return fmt.Errorf("error converting peer to libp2p addr info: %w", err)
}

err = provideRow(
Expand Down

0 comments on commit 64ec990

Please sign in to comment.