From ca3893058cbfc05d750983d720c52ebaea8cbb6e Mon Sep 17 00:00:00 2001 From: Kien Nguyen-Tuan Date: Fri, 11 Oct 2019 19:05:06 +0700 Subject: [PATCH] Consolidate invalid address log (#2063) The Invalid listen address errors should be as same as Invalid advertise address. Signed-off-by: Kien Nguyen --- cluster/cluster.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cluster/cluster.go b/cluster/cluster.go index 20c7a1c3..57d82bdc 100644 --- a/cluster/cluster.go +++ b/cluster/cluster.go @@ -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) } }