From f3105a434f3bd2fb3f8899e4861e187e786b03da Mon Sep 17 00:00:00 2001 From: Jeff Widman Date: Sat, 17 Nov 2018 01:37:15 -0800 Subject: Stop using broker-errors for client-side problems `UnsupportedVersionError` is intended to indicate a server-side error: https://github.com/dpkp/kafka-python/blob/ba7372e44ffa1ee49fb4d5efbd67534393e944db/kafka/errors.py#L375-L378 So we should not be raising it for client-side errors. I realize that semantically this seems like the appropriate error to raise. However, this is confusing when debugging... for a real-life example, see https://github.com/Parsely/pykafka/issues/697. So I strongly feel that server-side errors should be kept separate from client-side errors, even if all the client is doing is proactively protecting against hitting a situation where the broker would return this error. --- kafka/errors.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'kafka/errors.py') diff --git a/kafka/errors.py b/kafka/errors.py index fb9576c..118e430 100644 --- a/kafka/errors.py +++ b/kafka/errors.py @@ -62,6 +62,10 @@ class UnrecognizedBrokerVersion(KafkaError): pass +class IncompatibleBrokerVersion(KafkaError): + pass + + class CommitFailedError(KafkaError): def __init__(self, *args, **kwargs): super(CommitFailedError, self).__init__( -- cgit v1.2.1