mirror of
https://github.com/ipfs/kubo.git
synced 2025-09-10 09:52:20 +08:00
remove debugerrors
We now consider debugerrors harmful: we've run into cases where debugerror.Wrap() hid valuable error information (err == io.EOF?). I've removed them from the main code, but left them in some tests. Go errors are lacking, but unfortunately, this isn't the solution. It is possible that debugerros.New or debugerrors.Errorf should remain still (i.e. only remove debugerrors.Wrap) but we don't use these errors often enough to keep.
This commit is contained in:
@ -13,7 +13,6 @@ import (
|
||||
kb "github.com/ipfs/go-ipfs/routing/kbucket"
|
||||
record "github.com/ipfs/go-ipfs/routing/record"
|
||||
u "github.com/ipfs/go-ipfs/util"
|
||||
errors "github.com/ipfs/go-ipfs/util/debugerror"
|
||||
pset "github.com/ipfs/go-ipfs/util/peerset"
|
||||
)
|
||||
|
||||
@ -95,7 +94,7 @@ func (dht *IpfsDHT) GetValue(ctx context.Context, key u.Key) ([]byte, error) {
|
||||
log.Debugf("peers in rt: %s", len(rtp), rtp)
|
||||
if len(rtp) == 0 {
|
||||
log.Warning("No peers from routing table!")
|
||||
return nil, errors.Wrap(kb.ErrLookupFailure)
|
||||
return nil, kb.ErrLookupFailure
|
||||
}
|
||||
|
||||
// setup the Query
|
||||
@ -278,7 +277,7 @@ func (dht *IpfsDHT) FindPeer(ctx context.Context, id peer.ID) (peer.PeerInfo, er
|
||||
|
||||
peers := dht.routingTable.NearestPeers(kb.ConvertPeerID(id), AlphaValue)
|
||||
if len(peers) == 0 {
|
||||
return peer.PeerInfo{}, errors.Wrap(kb.ErrLookupFailure)
|
||||
return peer.PeerInfo{}, kb.ErrLookupFailure
|
||||
}
|
||||
|
||||
// Sanity...
|
||||
@ -344,7 +343,7 @@ func (dht *IpfsDHT) FindPeersConnectedToPeer(ctx context.Context, id peer.ID) (<
|
||||
|
||||
peers := dht.routingTable.NearestPeers(kb.ConvertPeerID(id), AlphaValue)
|
||||
if len(peers) == 0 {
|
||||
return nil, errors.Wrap(kb.ErrLookupFailure)
|
||||
return nil, kb.ErrLookupFailure
|
||||
}
|
||||
|
||||
// setup the Query
|
||||
|
Reference in New Issue
Block a user