Skip to content
This repository has been archived by the owner on May 26, 2022. It is now read-only.

Commit

Permalink
Return last dial error on unsuccessful dial
Browse files Browse the repository at this point in the history
  • Loading branch information
anacrolix committed Feb 4, 2019
1 parent 4b96847 commit b349cb4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion swarm_dial.go
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,11 @@ func (s *Swarm) dialAddrs(ctx context.Context, p peer.ID, remoteAddrs <-chan ma.
}
}
}
return nil, errors.New("no remote addresses")
if lastDialErr != nil {
return nil, lastDialErr
} else {
return nil, errors.New("no remote addresses")
}
}

// limitedDial will start a dial to the given peer when
Expand Down

0 comments on commit b349cb4

Please # to comment.