From 37f9b68b33b83fdf0bcc7ab4932fc4d9483eef51 Mon Sep 17 00:00:00 2001 From: Shubhang Balkundi Date: Thu, 4 Apr 2024 11:05:03 +0530 Subject: [PATCH] removes sentitnel error --- kafka/errors.go | 9 --------- kafka/kafkahelper.go | 3 ++- 2 files changed, 2 insertions(+), 10 deletions(-) delete mode 100644 kafka/errors.go diff --git a/kafka/errors.go b/kafka/errors.go deleted file mode 100644 index 7a83919..0000000 --- a/kafka/errors.go +++ /dev/null @@ -1,9 +0,0 @@ -package kafka - -import ( - "errors" -) - -var ( - ErrPart = errors.New("error in partition") -) diff --git a/kafka/kafkahelper.go b/kafka/kafkahelper.go index 23d31b8..9a239e5 100644 --- a/kafka/kafkahelper.go +++ b/kafka/kafkahelper.go @@ -1,6 +1,7 @@ package kafka import ( + "fmt" "github.com/confluentinc/confluent-kafka-go/v2/kafka" ) @@ -20,7 +21,7 @@ func createConsumer(consumerConfig *kafka.ConfigMap, topics []string) confluentC // offsets are stored in memory and are later flushed by the auto-commit timer func storeOffsets(consumer confluentConsumer, partition kafka.TopicPartition) error { if partition.Error != nil { - return ErrPart + return fmt.Errorf("error storing offsets:%w", partition.Error) } offsets := []kafka.TopicPartition{partition} offsets[0].Offset++