Skip to content

Commit

Permalink
Merge pull request #3 from libp2p/fix/log-error-printing
Browse files Browse the repository at this point in the history
expose errors in log messages
  • Loading branch information
whyrusleeping authored Oct 25, 2016
2 parents c71f968 + c88fe55 commit b5f4e8e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions p2p/net/swarm/swarm_dial.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ func (s *Swarm) dial(ctx context.Context, p peer.ID) (*Conn, error) {
// try to get a connection to any addr
connC, err := s.dialAddrs(ctx, p, remoteAddrChan)
if err != nil {
logdial["error"] = err
logdial["error"] = err.Error()
return nil, err
}
logdial["netconn"] = lgbl.NetConn(connC)
Expand All @@ -275,7 +275,7 @@ func (s *Swarm) dial(ctx context.Context, p peer.ID) (*Conn, error) {
defer log.EventBegin(ctx, "swarmDialDoSetup", logdial, lgbl.NetConn(connC)).Done()
swarmC, err := dialConnSetup(ctx, s, connC)
if err != nil {
logdial["error"] = err
logdial["error"] = err.Error()
connC.Close() // close the connection. didn't work out :(
return nil, err
}
Expand Down

0 comments on commit b5f4e8e

Please sign in to comment.