diff options
author | Jeff Widman <jeff@jeffwidman.com> | 2018-05-10 16:12:19 -0700 |
---|---|---|
committer | Jeff Widman <jeff@jeffwidman.com> | 2018-05-23 15:19:01 -0700 |
commit | 11cf3973bfc64ab0b4e471fc56dae911df1ec8d9 (patch) | |
tree | 474937a8c01bb32a3b12a944d9a9ad6b32d81800 /kafka/errors.py | |
parent | 9221fcf83528b5c3657e43636cb84c1d18025acd (diff) | |
download | kafka-python-11cf3973bfc64ab0b4e471fc56dae911df1ec8d9.tar.gz |
Stop shadowing `ConnectionError`
In Python3, `ConnectionError` is a native exception. So rename our
custom one to `KafkaConnectionError` to prevent accidentally
shadowing the native one.
Note that there are still valid uses of `ConnectionError` in this code.
They already expect a native Python3 `ConnectionError`, and also already
handle the Python2 compatibility issues.
Diffstat (limited to 'kafka/errors.py')
-rw-r--r-- | kafka/errors.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/kafka/errors.py b/kafka/errors.py index c70853c..f4c8740 100644 --- a/kafka/errors.py +++ b/kafka/errors.py @@ -447,7 +447,7 @@ class FailedPayloadsError(KafkaError): self.payload = payload -class ConnectionError(KafkaError): +class KafkaConnectionError(KafkaError): retriable = True invalid_metadata = True @@ -517,13 +517,13 @@ def check_error(response): RETRY_BACKOFF_ERROR_TYPES = ( KafkaUnavailableError, LeaderNotAvailableError, - ConnectionError, FailedPayloadsError + KafkaConnectionError, FailedPayloadsError ) RETRY_REFRESH_ERROR_TYPES = ( NotLeaderForPartitionError, UnknownTopicOrPartitionError, - LeaderNotAvailableError, ConnectionError + LeaderNotAvailableError, KafkaConnectionError ) |