diff options
author | Jeff Widman <jeff@jeffwidman.com> | 2018-11-17 01:37:15 -0800 |
---|---|---|
committer | Jeff Widman <jeff@jeffwidman.com> | 2018-11-18 00:20:55 -0800 |
commit | f3105a434f3bd2fb3f8899e4861e187e786b03da (patch) | |
tree | 7b7edf67ddd79f9ef63b399c05adb776790e5e12 /kafka/conn.py | |
parent | 7bd6b5da6d402565f25fce9e710be26b2d4cc125 (diff) | |
download | kafka-python-f3105a434f3bd2fb3f8899e4861e187e786b03da.tar.gz |
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.
Diffstat (limited to 'kafka/conn.py')
-rw-r--r-- | kafka/conn.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kafka/conn.py b/kafka/conn.py index 5ec9757..471bae7 100644 --- a/kafka/conn.py +++ b/kafka/conn.py @@ -881,7 +881,7 @@ class BrokerConnection(object): .format(version)) # _api_versions is set as a side effect of check_versions() on a cluster # that supports 0.10.0 or later - return self._api_versions; + return self._api_versions def _infer_broker_version_from_api_versions(self, api_versions): # The logic here is to check the list of supported request versions |