diff options
author | Omar Ghishan <omar.ghishan@rd.io> | 2014-01-08 11:30:15 -0800 |
---|---|---|
committer | Omar Ghishan <omar.ghishan@rd.io> | 2014-01-08 11:30:15 -0800 |
commit | 317c8480164763b484fa82d0e0273107bc861538 (patch) | |
tree | 8f38432768a297b72177f31ee8c08f1b2d5979e8 /kafka/conn.py | |
parent | 9cbe45d2358d563bb2844eecaa545e7f6d0a6629 (diff) | |
download | kafka-python-317c8480164763b484fa82d0e0273107bc861538.tar.gz |
Change BufferUnderflowError to ConnectionError in conn._read_bytes()
Both errors are handled the same way when raised and caught, so this makes sense.
Diffstat (limited to 'kafka/conn.py')
-rw-r--r-- | kafka/conn.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/kafka/conn.py b/kafka/conn.py index b2916ce..9a6633a 100644 --- a/kafka/conn.py +++ b/kafka/conn.py @@ -4,7 +4,6 @@ import socket import struct from threading import local -from kafka.common import BufferUnderflowError from kafka.common import ConnectionError log = logging.getLogger("kafka") @@ -53,8 +52,8 @@ class KafkaConnection(local): log.error('Unable to receive data from Kafka: %s', e) self._raise_connection_error() if data == '': - self._dirty = True - raise BufferUnderflowError("Not enough data to read this response") + log.error("Not enough data to read this response") + self._raise_connection_error() bytes_left -= len(data) log.debug("Read %d/%d bytes from Kafka", num_bytes - bytes_left, num_bytes) resp += data |