Skip to content

Commit

Permalink
isRetriableBrokerErr: nil error is **not** retriable
Browse files Browse the repository at this point in the history
Closes #79
  • Loading branch information
twmb committed Sep 3, 2021
1 parent 33635e2 commit 1469495
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkg/kgo/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@ import (
)

func isRetriableBrokerErr(err error) bool {
if err == nil { // sanity
return true
// The error could be nil if we are evaluating multiple errors at once,
// and only one is non-nil. The intent of this function is to evaluate
// whether an **error** is retriable, not a non-error. We return that
// nil is not retriable -- the calling code evaluating multiple errors
// at once would not call into this function if all errors were nil.
if err == nil {
return false
}
// https://github.com/golang/go/issues/45729
//
Expand Down

0 comments on commit 1469495

Please sign in to comment.