MCPcopy
hub / github.com/segmentio/kafka-go / Temporary

Method Temporary

error.go:138–173  ·  view source on GitHub ↗

Temporary returns true if the operation that generated the error may succeed if retried at a later time. Kafka error documentation specifies these as "retriable" https://kafka.apache.org/protocol#protocol_error_codes

()

Source from the content-addressed store, hash-verified

136// Kafka error documentation specifies these as "retriable"
137// https://kafka.apache.org/protocol#protocol_error_codes
138func (e Error) Temporary() bool {
139 switch e {
140 case InvalidMessage,
141 UnknownTopicOrPartition,
142 LeaderNotAvailable,
143 NotLeaderForPartition,
144 RequestTimedOut,
145 NetworkException,
146 GroupLoadInProgress,
147 GroupCoordinatorNotAvailable,
148 NotCoordinatorForGroup,
149 NotEnoughReplicas,
150 NotEnoughReplicasAfterAppend,
151 NotController,
152 KafkaStorageError,
153 FetchSessionIDNotFound,
154 InvalidFetchSessionEpoch,
155 ListenerNotFound,
156 FencedLeaderEpoch,
157 UnknownLeaderEpoch,
158 OffsetNotAvailable,
159 PreferredLeaderNotAvailable,
160 EligibleLeadersNotAvailable,
161 ElectionNotNeeded,
162 NoReassignmentInProgress,
163 GroupSubscribedToTopic,
164 UnstableOffsetCommit,
165 ThrottlingQuotaExceeded,
166 UnknownTopicID,
167 InconsistentTopicID,
168 FetchSessionTopicIDError:
169 return true
170 default:
171 return false
172 }
173}
174
175// Title returns a human readable title for the error.
176func (e Error) Title() string {

Callers 1

isTemporaryFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected