Skip to content

Commit

Permalink
Improve connection error message and fail on non-temporary dial errors (
Browse files Browse the repository at this point in the history
  • Loading branch information
alexashley authored Aug 27, 2021
1 parent d6bc9ec commit f61a9d2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ func (s *staticCredential) RequireTransportSecurity() bool {
func newBuildCollectorClient(c *config) (*grpc.ClientConn, collector.BuildCollectorClient) {
dialOptions := []grpc.DialOption{
grpc.WithBlock(),
grpc.FailOnNonTempDialError(true),
}
if c.BuildCollector.Insecure {
dialOptions = append(dialOptions, grpc.WithInsecure())
Expand All @@ -91,7 +92,7 @@ func newBuildCollectorClient(c *config) (*grpc.ClientConn, collector.BuildCollec
defer cancel()
conn, err := grpc.DialContext(ctx, c.BuildCollector.Host, dialOptions...)
if err != nil {
log.Fatal(err)
log.Fatalf("Unable to connect to build collector: %v", err)
}

return conn, collector.NewBuildCollectorClient(conn)
Expand Down

0 comments on commit f61a9d2

Please sign in to comment.