refactor: move dialer's errorwrapper in i/errorsx (#417)

Part of https://github.com/ooni/probe/issues/1505
This commit is contained in:
Simone Basso 2021-07-01 17:15:44 +02:00 committed by GitHub
commit ceefcaf45e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 31 additions and 26 deletions

View file

@ -6,6 +6,7 @@ import (
"net/url"
"github.com/ooni/probe-cli/v3/internal/engine/netx/trace"
"github.com/ooni/probe-cli/v3/internal/errorsx"
"github.com/ooni/probe-cli/v3/internal/netxlite"
)
@ -69,7 +70,7 @@ type Config struct {
// New creates a new Dialer from the specified config and resolver.
func New(config *Config, resolver Resolver) Dialer {
var d Dialer = netxlite.DefaultDialer
d = &errorWrapperDialer{Dialer: d}
d = &errorsx.ErrorWrapperDialer{Dialer: d}
if config.Logger != nil {
d = &netxlite.DialerLogger{Dialer: d, Logger: config.Logger}
}