Skip to content

Commit

Permalink
Merge pull request #1397 from MikeSchlosser16/master
Browse files Browse the repository at this point in the history
Add Kafka error codes 77-81
  • Loading branch information
bai authored Jun 17, 2019
2 parents cd910a6 + 903cb80 commit 0dbba7e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,11 @@ const (
ErrFencedLeaderEpoch KError = 74
ErrUnknownLeaderEpoch KError = 75
ErrUnsupportedCompressionType KError = 76
ErrStaleBrokerEpoch KError = 77
ErrOffsetNotAvailable KError = 78
ErrMemberIdRequired KError = 79
ErrPreferredLeaderNotAvailable KError = 80
ErrGroupMaxSizeReached KError = 81
)

func (err KError) Error() string {
Expand Down Expand Up @@ -323,6 +328,16 @@ func (err KError) Error() string {
return "kafka server: The leader epoch in the request is newer than the epoch on the broker."
case ErrUnsupportedCompressionType:
return "kafka server: The requesting client does not support the compression type of given partition."
case ErrStaleBrokerEpoch:
return "kafka server: Broker epoch has changed"
case ErrOffsetNotAvailable:
return "kafka server: The leader high watermark has not caught up from a recent leader election so the offsets cannot be guaranteed to be monotonically increasing"
case ErrMemberIdRequired:
return "kafka server: The group member needs to have a valid member id before actually entering a consumer group"
case ErrPreferredLeaderNotAvailable:
return "kafka server: The preferred leader was not available"
case ErrGroupMaxSizeReached:
return "kafka server: Consumer group The consumer group has reached its max size. already has the configured maximum number of members."
}

return fmt.Sprintf("Unknown error, how did this happen? Error code = %d", err)
Expand Down

0 comments on commit 0dbba7e

Please sign in to comment.