diff --git a/pkg/kafka/consumer/config.go b/pkg/kafka/consumer/config.go index b48b6d2cc67..a561f79596c 100644 --- a/pkg/kafka/consumer/config.go +++ b/pkg/kafka/consumer/config.go @@ -15,6 +15,7 @@ package consumer import ( + "fmt" "time" "github.com/Shopify/sarama" @@ -68,7 +69,7 @@ func (c *Configuration) NewConsumer(logger *zap.Logger) (Consumer, error) { saramaConfig.Consumer.Offsets.CommitInterval = time.Second client, err := sarama.NewConsumerGroup(c.Brokers, c.GroupID, saramaConfig) if err != nil { - logger.Panic("error creating consumer group client", zap.Error(err)) + return nil, fmt.Errorf("error creating consumer group client: %w", err) } return client, err }