Skip to content

Commit 0b5e1f6

Browse files
authored
Bring the list of error codes up to date (#902)
https://kafka.apache.org/protocol.html#protocol_error_codes
1 parent 6691dda commit 0b5e1f6

File tree

1 file changed

+95
-1
lines changed

1 file changed

+95
-1
lines changed

error.go

Lines changed: 95 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,24 @@ const (
101101
GroupSubscribedToTopic Error = 86
102102
InvalidRecord Error = 87
103103
UnstableOffsetCommit Error = 88
104+
ThrottlingQuotaExceeded Error = 89
105+
ProducerFenced Error = 90
106+
ResourceNotFound Error = 91
107+
DuplicateResource Error = 92
108+
UnacceptableCredential Error = 93
109+
InconsistentVoterSet Error = 94
110+
InvalidUpdateVersion Error = 95
111+
FeatureUpdateFailed Error = 96
112+
PrincipalDeserializationFailure Error = 97
113+
SnapshotNotFound Error = 98
114+
PositionOutOfRange Error = 99
115+
UnknownTopicID Error = 100
116+
DuplicateBrokerRegistration Error = 101
117+
BrokerIDNotRegistered Error = 102
118+
InconsistentTopicID Error = 103
119+
InconsistentClusterID Error = 104
120+
TransactionalIDNotFound Error = 105
121+
FetchSessionTopicIDError Error = 106
104122
)
105123

106124
// Error satisfies the error interface.
@@ -143,7 +161,11 @@ func (e Error) Temporary() bool {
143161
ElectionNotNeeded,
144162
NoReassignmentInProgress,
145163
GroupSubscribedToTopic,
146-
UnstableOffsetCommit:
164+
UnstableOffsetCommit,
165+
ThrottlingQuotaExceeded,
166+
UnknownTopicID,
167+
InconsistentTopicID,
168+
FetchSessionTopicIDError:
147169
return true
148170
default:
149171
return false
@@ -317,6 +339,42 @@ func (e Error) Title() string {
317339
return "Invalid Record"
318340
case UnstableOffsetCommit:
319341
return "Unstable Offset Commit"
342+
case ThrottlingQuotaExceeded:
343+
return "Throttling Quota Exceeded"
344+
case ProducerFenced:
345+
return "Producer Fenced"
346+
case ResourceNotFound:
347+
return "Resource Not Found"
348+
case DuplicateResource:
349+
return "Duplicate Resource"
350+
case UnacceptableCredential:
351+
return "Unacceptable Credential"
352+
case InconsistentVoterSet:
353+
return "Inconsistent Voter Set"
354+
case InvalidUpdateVersion:
355+
return "Invalid Update Version"
356+
case FeatureUpdateFailed:
357+
return "Feature Update Failed"
358+
case PrincipalDeserializationFailure:
359+
return "Principal Deserialization Failure"
360+
case SnapshotNotFound:
361+
return "Snapshot Not Found"
362+
case PositionOutOfRange:
363+
return "Position Out Of Range"
364+
case UnknownTopicID:
365+
return "Unknown Topic ID"
366+
case DuplicateBrokerRegistration:
367+
return "Duplicate Broker Registration"
368+
case BrokerIDNotRegistered:
369+
return "Broker ID Not Registered"
370+
case InconsistentTopicID:
371+
return "Inconsistent Topic ID"
372+
case InconsistentClusterID:
373+
return "Inconsistent Cluster ID"
374+
case TransactionalIDNotFound:
375+
return "Transactional ID Not Found"
376+
case FetchSessionTopicIDError:
377+
return "Fetch Session Topic ID Error"
320378
}
321379
return ""
322380
}
@@ -488,6 +546,42 @@ func (e Error) Description() string {
488546
return "this record has failed the validation on broker and hence be rejected"
489547
case UnstableOffsetCommit:
490548
return "there are unstable offsets that need to be cleared"
549+
case ThrottlingQuotaExceeded:
550+
return "The throttling quota has been exceeded"
551+
case ProducerFenced:
552+
return "There is a newer producer with the same transactionalId which fences the current one"
553+
case ResourceNotFound:
554+
return "A request illegally referred to a resource that does not exist"
555+
case DuplicateResource:
556+
return "A request illegally referred to the same resource twice"
557+
case UnacceptableCredential:
558+
return "Requested credential would not meet criteria for acceptability"
559+
case InconsistentVoterSet:
560+
return "Indicates that the either the sender or recipient of a voter-only request is not one of the expected voters"
561+
case InvalidUpdateVersion:
562+
return "The given update version was invalid"
563+
case FeatureUpdateFailed:
564+
return "Unable to update finalized features due to an unexpected server error"
565+
case PrincipalDeserializationFailure:
566+
return "Request principal deserialization failed during forwarding. This indicates an internal error on the broker cluster security setup"
567+
case SnapshotNotFound:
568+
return "Requested snapshot was not found"
569+
case PositionOutOfRange:
570+
return "Requested position is not greater than or equal to zero, and less than the size of the snapshot"
571+
case UnknownTopicID:
572+
return "This server does not host this topic ID"
573+
case DuplicateBrokerRegistration:
574+
return "This broker ID is already in use"
575+
case BrokerIDNotRegistered:
576+
return "The given broker ID was not registered"
577+
case InconsistentTopicID:
578+
return "The log's topic ID did not match the topic ID in the request"
579+
case InconsistentClusterID:
580+
return "The clusterId in the request does not match that found on the server"
581+
case TransactionalIDNotFound:
582+
return "The transactionalId could not be found"
583+
case FetchSessionTopicIDError:
584+
return "The fetch session encountered inconsistent topic ID usage"
491585
}
492586
return ""
493587
}

0 commit comments

Comments
 (0)