From babcae3256fa0e709fb7ce11311d3de9daa00d5e Mon Sep 17 00:00:00 2001 From: "antoine.choimet" Date: Thu, 21 Nov 2024 15:10:23 +0100 Subject: [PATCH] fix: better error handling for multiple election failed --- extkafka/partition_attack_elect_new_leader.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extkafka/partition_attack_elect_new_leader.go b/extkafka/partition_attack_elect_new_leader.go index e3d5602..0c4f567 100644 --- a/extkafka/partition_attack_elect_new_leader.go +++ b/extkafka/partition_attack_elect_new_leader.go @@ -132,7 +132,7 @@ func (f kafkaBrokerElectNewLeaderAttack) Start(ctx context.Context, state *Kafka Level: extutil.Ptr(action_kit_api.Warn), Message: fmt.Sprintf("Error while electing leader for topic '%s', partition %d, error is: %s", t, partition, result.Err.Error()), }) - errs = append(errs, errors.New(fmt.Sprintf("Error while electing leader for topic '%s', partition %d, error is: %s", t, partition, result.Err.Error()))) + errs = append(errs, fmt.Errorf("error while electing leader for topic '%s', partition %d, error is: %s", t, partition, result.Err.Error())) } else { messages = append(messages, action_kit_api.Message{ Level: extutil.Ptr(action_kit_api.Info),