jet / kafunk

Kafunk: F# Kafka client
https://jet.github.io/kafunk/
Other
160 stars 63 forks source link

Error messages in the consumer #150

Open dservgun opened 7 years ago

dservgun commented 7 years ago

0001-Added-error-codes-for-consumer.patch.txt Should we add the following error codes in the consumer? The generic message reads "unsupported commit offset error_code=%i" ec)) if we accept this change the generic message may need to reflect a kafka error?

                   | ErrorCode.NoError -> None
-                  | ErrorCode.IllegalGenerationCode | ErrorCode.UnknownMemberIdCode 
+                  | ErrorCode.BrokerNotAvailable | ErrorCode.ClusterAuthorizationFailedCode
+                  | ErrorCode.GroupAuthorizationFailedCode | ErrorCode.GroupCoordinatorNotAvailableCode
+                  | ErrorCode.GroupLoadInProgressCode | ErrorCode.InconsistentGroupProtocolCode
+                  | ErrorCode.InvalidCommitOffsetSizeCode | ErrorCode.InvalidGroupIdCode
+                  | ErrorCode.InvalidMessage | ErrorCode.InvalidMessageSize
+                  | ErrorCode.InvalidRequiredAcksCode | ErrorCode.InvalidSessionTimeoutCode
+                  | ErrorCode.InvalidTopicCode | ErrorCode.LeaderNotAvailable
+                  | ErrorCode.MessageSizeTooLarge | ErrorCode.NotEnoughReplicasAfterAppendCode
+                  | ErrorCode.NotLeaderForPartition | ErrorCode.RecordListTooLargeCode
+                  | ErrorCode.ReplicaNotAvailable | ErrorCode.RequestTimedOut
+                  | ErrorCode.StaleControllerEpochCode | ErrorCode.TopicAuthorizationFailedCode
+                  | ErrorCode.UnknownTopicOrPartition
+                  | ErrorCode.IllegalGenerationCode | ErrorCode.UnknownMemberIdCode
                   | ErrorCode.RebalanceInProgressCode | ErrorCode.NotCoordinatorForGroupCode -> Some (p,ec)
                   | _ -> failwithf "general server error_code=%i" ec))