Skip to content

Commit

Permalink
do not use logger.Fatal when testing connection
Browse files Browse the repository at this point in the history
this makes it impossible to use the method from a library.
  • Loading branch information
alenkacz committed May 29, 2022
1 parent ea8dbba commit f848ea9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kafka/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func (s *Service) CreateAndTestClient(ctx context.Context, l *zap.Logger, opts [
defer cancel()
err = s.testConnection(client, connectCtx)
if err != nil {
logger.Fatal("failed to test connectivity to Kafka cluster", zap.Error(err))
return nil, fmt.Errorf("failed to test connectivity to Kafka cluster %w", err)
}

return client, nil
Expand Down

0 comments on commit f848ea9

Please sign in to comment.