Use ConnectionError rather than new DisconnectError

This commit is contained in:
Dana Powers
2015-12-29 17:48:10 -08:00
parent 563e38a84f
commit c549a2b403
2 changed files with 4 additions and 8 deletions

View File

@@ -106,11 +106,6 @@ class IllegalArgumentError(KafkaError):
pass
class DisconnectError(KafkaError):
retriable = True
invalid_metadata = True
class NoBrokersAvailable(KafkaError):
retriable = True
invalid_metadata = True
@@ -412,7 +407,8 @@ class FailedPayloadsError(KafkaError):
class ConnectionError(KafkaError):
pass
retriable = True
invalid_metadata = True
class BufferUnderflowError(KafkaError):

View File

@@ -128,7 +128,7 @@ class BrokerConnection(object):
self._rbuffer.seek(0)
self._rbuffer.truncate()
if error is None:
error = Errors.DisconnectError()
error = Errors.ConnectionError()
while self.in_flight_requests:
ifr = self.in_flight_requests.popleft()
ifr.future.failure(error)
@@ -140,7 +140,7 @@ class BrokerConnection(object):
"""
future = Future()
if not self.connected():
return future.failure(Errors.DisconnectError())
return future.failure(Errors.ConnectionError())
if not self.can_send_more():
return future.failure(Errors.TooManyInFlightRequests())
self._correlation_id += 1