Skip to content

Commit

Permalink
fix: better error handling for multiple election failed
Browse files Browse the repository at this point in the history
  • Loading branch information
achoimet committed Nov 21, 2024
1 parent e7a6085 commit 368c669
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion extkafka/partition_attack_elect_new_leader.go
Original file line number Diff line number Diff line change
Expand Up @@ -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, result.Err)
errs = append(errs, errors.New(fmt.Sprintf("Error while electing leader for topic '%s', partition %d, error is: %s", t, partition, result.Err.Error())))

Check failure on line 135 in extkafka/partition_attack_elect_new_leader.go

View workflow job for this annotation

GitHub Actions / extension-ci / Audit

should use fmt.Errorf(...) instead of errors.New(fmt.Sprintf(...)) (S1028)
} else {
messages = append(messages, action_kit_api.Message{
Level: extutil.Ptr(action_kit_api.Info),
Expand Down

0 comments on commit 368c669

Please sign in to comment.