From d5ba4fa41ea9bc37d5846fddf5245531304b4c4b Mon Sep 17 00:00:00 2001 From: Paul Lorenz Date: Thu, 11 Aug 2022 13:53:48 -0400 Subject: [PATCH] Fix error type, should be misconfigured not invalid error --- router/xgress_transport/dialer.go | 2 +- router/xgress_transport_udp/dialer.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/router/xgress_transport/dialer.go b/router/xgress_transport/dialer.go index c61b2c1e7..6e3e4a50a 100644 --- a/router/xgress_transport/dialer.go +++ b/router/xgress_transport/dialer.go @@ -56,7 +56,7 @@ func (txd *dialer) Dial(destination string, circuitId *identity.TokenId, address txDestination, err := transport.ParseAddress(destination) if err != nil { - return nil, errors.Wrapf(err, "cannot dial on invalid address [%s]", destination) + return nil, xgress.MisconfiguredTerminatorError{InnerError: errors.Wrapf(err, "cannot dial on invalid address [%s]", destination)} } log.Debug("dialing") diff --git a/router/xgress_transport_udp/dialer.go b/router/xgress_transport_udp/dialer.go index 6a7eeb1c8..cd9f81b92 100644 --- a/router/xgress_transport_udp/dialer.go +++ b/router/xgress_transport_udp/dialer.go @@ -17,7 +17,7 @@ package xgress_transport_udp import ( - "fmt" + "github.com/pkg/errors" "net" "time" @@ -37,7 +37,7 @@ func (txd *dialer) Dial(destination string, circuitId *identity.TokenId, address log.Debugf("parsing %v for xgress address: %v", destination, address) packetAddress, err := xgress_udp.Parse(destination) if err != nil { - return nil, fmt.Errorf("cannot dial on invalid address [%s] (%w)", destination, err) + return nil, xgress.MisconfiguredTerminatorError{InnerError: errors.Wrapf(err, "cannot dial on invalid address [%s]", destination)} } log.Debugf("dialing packet address [%v]", packetAddress)