summaryrefslogtreecommitdiff
path: root/kafka/client.py
diff options
context:
space:
mode:
Diffstat (limited to 'kafka/client.py')
-rw-r--r--kafka/client.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/kafka/client.py b/kafka/client.py
index 10b1724..789d4da 100644
--- a/kafka/client.py
+++ b/kafka/client.py
@@ -11,7 +11,7 @@ import select
from kafka.vendor import six
import kafka.errors
-from kafka.errors import (UnknownError, ConnectionError, FailedPayloadsError,
+from kafka.errors import (UnknownError, KafkaConnectionError, FailedPayloadsError,
KafkaTimeoutError, KafkaUnavailableError,
LeaderNotAvailableError, UnknownTopicOrPartitionError,
NotLeaderForPartitionError, ReplicaNotAvailableError)
@@ -73,7 +73,7 @@ class SimpleClient(object):
conn = self._conns[host_key]
if not conn.connect_blocking(self.timeout):
conn.close()
- raise ConnectionError("%s:%s (%s)" % (host, port, afi))
+ raise KafkaConnectionError("%s:%s (%s)" % (host, port, afi))
return conn
def _get_leader_for_partition(self, topic, partition):
@@ -156,7 +156,7 @@ class SimpleClient(object):
for (host, port, afi) in hosts:
try:
conn = self._get_conn(host, port, afi)
- except ConnectionError:
+ except KafkaConnectionError:
log.warning("Skipping unconnected connection: %s:%s (AFI %s)",
host, port, afi)
continue
@@ -242,7 +242,7 @@ class SimpleClient(object):
host, port, afi = get_ip_port_afi(broker.host)
try:
conn = self._get_conn(host, broker.port, afi)
- except ConnectionError:
+ except KafkaConnectionError:
refresh_metadata = True
failed_payloads(broker_payloads)
continue
@@ -344,8 +344,8 @@ class SimpleClient(object):
try:
host, port, afi = get_ip_port_afi(broker.host)
conn = self._get_conn(host, broker.port, afi)
- except ConnectionError as e:
- log.warning('ConnectionError attempting to send request %s '
+ except KafkaConnectionError as e:
+ log.warning('KafkaConnectionError attempting to send request %s '
'to server %s: %s', request_id, broker, e)
for payload in payloads: