Consolidate invalid address log (#2063)
The Invalid listen address errors should be as same as Invalid advertise address. Signed-off-by: Kien Nguyen <kiennt2609@gmail.com>
This commit is contained in:
parent
f3a2ff8b7f
commit
ca3893058c
|
@ -121,11 +121,11 @@ func Create(
|
|||
) (*Peer, error) {
|
||||
bindHost, bindPortStr, err := net.SplitHostPort(bindAddr)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, errors.Wrap(err, "invalid listen address")
|
||||
}
|
||||
bindPort, err := strconv.Atoi(bindPortStr)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "invalid listen address")
|
||||
return nil, errors.Wrapf(err, "address %s: invalid port", bindAddr)
|
||||
}
|
||||
|
||||
var advertiseHost string
|
||||
|
@ -138,7 +138,7 @@ func Create(
|
|||
}
|
||||
advertisePort, err = strconv.Atoi(advertisePortStr)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "invalid advertise address, wrong port")
|
||||
return nil, errors.Wrapf(err, "address %s: invalid port", advertiseAddr)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue