Skip to content

Commit

Permalink
More places where errors.Join was used
Browse files Browse the repository at this point in the history
Signed-off-by: Pablo Baeyens <pablo.baeyens@datadoghq.com>
  • Loading branch information
mx-psi committed Mar 22, 2023
1 parent e2fa30f commit 62e9cc8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions cmd/agent/app/reporter/grpc/collector_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
package grpc

import (
"errors"
"io"

"go.uber.org/zap"
Expand All @@ -25,6 +24,7 @@ import (
grpcManager "github.com/jaegertracing/jaeger/cmd/agent/app/configmanager/grpc"
"github.com/jaegertracing/jaeger/cmd/agent/app/reporter"
"github.com/jaegertracing/jaeger/pkg/metrics"
"github.com/jaegertracing/jaeger/pkg/multierror"
)

// ProxyBuilder holds objects communicating with collector
Expand Down Expand Up @@ -74,9 +74,9 @@ func (b ProxyBuilder) GetManager() configmanager.ClientConfigManager {

// Close closes connections used by proxy.
func (b ProxyBuilder) Close() error {
return errors.Join(
return multierror.Wrap([]error{
b.reporter.Close(),
b.tlsCloser.Close(),
b.GetConn().Close(),
)
})
}
4 changes: 2 additions & 2 deletions pkg/config/tlscfg/cert_watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ package tlscfg
import (
"crypto/tls"
"crypto/x509"
"errors"
"fmt"
"io"
"path/filepath"
Expand All @@ -26,6 +25,7 @@ import (
"go.uber.org/zap"

"github.com/jaegertracing/jaeger/pkg/fswatcher"
"github.com/jaegertracing/jaeger/pkg/multierror"
)

const (
Expand Down Expand Up @@ -84,7 +84,7 @@ func (w *certWatcher) Close() error {
for _, w := range w.watchers {
errs = append(errs, w.Close())
}
return errors.Join(errs...)
return multierror.Wrap(errs)
}

func (w *certWatcher) certificate() *tls.Certificate {
Expand Down

0 comments on commit 62e9cc8

Please sign in to comment.