Skip to content

Commit

Permalink
Make error more descriptive and reorder imports
Browse files Browse the repository at this point in the history
  • Loading branch information
marc-gr committed Dec 22, 2020
1 parent fef6689 commit 5e9b674
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions x-pack/filebeat/input/gcppubsub/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@ import (
"sync"
"time"

"google.golang.org/grpc"

"cloud.google.com/go/pubsub"
"github.com/pkg/errors"
"google.golang.org/api/option"
"google.golang.org/grpc"

"github.com/elastic/beats/v7/filebeat/channel"
"github.com/elastic/beats/v7/filebeat/input"
Expand Down Expand Up @@ -253,7 +252,7 @@ func (in *pubsubInput) newPubsubClient(ctx context.Context) (*pubsub.Client, err
// this will be typically set because we want to point the input to a testing pubsub emulator
conn, err := grpc.Dial(in.AlternativeHost, grpc.WithInsecure())
if err != nil {
return nil, fmt.Errorf("grpc.Dial: %w", err)
return nil, fmt.Errorf("cannot connect to alternative host %q: %w", in.AlternativeHost, err)
}
opts = append(opts, option.WithGRPCConn(conn), option.WithTelemetryDisabled())
}
Expand Down

0 comments on commit 5e9b674

Please sign in to comment.