From 715f8950a0af595adca87671c7d58a01e29e484f Mon Sep 17 00:00:00 2001 From: Jeromy Date: Fri, 24 Apr 2015 14:37:32 -0700 Subject: [PATCH] bring some errors that were being hidden in the dial sequence to the surface --- net/swarm/swarm_dial.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net/swarm/swarm_dial.go b/net/swarm/swarm_dial.go index 51dd39cd..a79aac8f 100644 --- a/net/swarm/swarm_dial.go +++ b/net/swarm/swarm_dial.go @@ -237,7 +237,8 @@ func (s *Swarm) gatedDialAttempt(ctx context.Context, p peer.ID) (*Conn, error) log.Event(ctx, "swarmDialBackoffAdd", logdial) s.backf.AddBackoff(p) // let others know to backoff - return nil, ErrDialFailed // ok, we failed. try again. (if loop is done, our error is output) + // ok, we failed. try again. (if loop is done, our error is output) + return nil, fmt.Errorf("dial attempt failed: %s", err) } log.Event(ctx, "swarmDialBackoffClear", logdial) s.backf.Clear(p) // okay, no longer need to backoff @@ -416,7 +417,7 @@ func (s *Swarm) dialAddrs(ctx context.Context, d *conn.Dialer, p peer.ID, remote for i := 0; i < len(remoteAddrs); i++ { select { case exitErr = <-errs: // - log.Debug(exitErr) + log.Warning("dial error: ", exitErr) case connC := <-conns: // take the first + return asap close(foundConn)