From 75efaee5cb0c9c3e8735ead473d863c337c96938 Mon Sep 17 00:00:00 2001 From: Hlib Kanunnikov Date: Fri, 3 Mar 2023 22:14:12 +0100 Subject: [PATCH] routed host: return connection error instead of routing error (#2169) --- p2p/host/routed/routed.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/p2p/host/routed/routed.go b/p2p/host/routed/routed.go index 0cedd48f5..c4601a50d 100644 --- a/p2p/host/routed/routed.go +++ b/p2p/host/routed/routed.go @@ -114,7 +114,8 @@ func (rh *RoutedHost) Connect(ctx context.Context, pi peer.AddrInfo) error { // try to connect again. newAddrs, err := rh.findPeerAddrs(ctx, pi.ID) if err != nil { - return fmt.Errorf("failed to find peers: %w", err) + log.Debugf("failed to find more peer addresses %s: %s", pi.ID, err) + return cerr } // Build lookup map