From c19022d4f10c9f2f1250f048096fd05d0d17843d Mon Sep 17 00:00:00 2001 From: Anton Berezhnyi Date: Thu, 30 May 2024 23:37:41 +0300 Subject: [PATCH] small fix --- KafkaConsumerProcessor.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/KafkaConsumerProcessor.go b/KafkaConsumerProcessor.go index 86b5af3..450c79c 100644 --- a/KafkaConsumerProcessor.go +++ b/KafkaConsumerProcessor.go @@ -3,6 +3,7 @@ package framework import ( "context" "encoding/json" + "errors" "fmt" "github.com/kneu-messenger-pigeon/events" "github.com/segmentio/kafka-go" @@ -71,7 +72,7 @@ func (processor *KafkaConsumerProcessor) Execute(ctx context.Context, wg *sync.W } } - if err != nil && err != context.Canceled { + if err != nil && !errors.Is(err, context.Canceled) { _, _ = fmt.Fprintf(processor.out, "%T error: %v \n", processor.handler, err) } }