From fbea5f04bccd28f3aa15a1711548b131504591ac Mon Sep 17 00:00:00 2001 From: Taras Date: Tue, 10 Oct 2017 00:13:16 +0300 Subject: Refactor MessageSet and Message into LegacyRecordBatch to later support v2 message format --- kafka/errors.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'kafka/errors.py') diff --git a/kafka/errors.py b/kafka/errors.py index c72455a..4a409db 100644 --- a/kafka/errors.py +++ b/kafka/errors.py @@ -101,12 +101,15 @@ class OffsetOutOfRangeError(BrokerResponseError): ' maintained by the server for the given topic/partition.') -class InvalidMessageError(BrokerResponseError): +class CorruptRecordException(BrokerResponseError): errno = 2 - message = 'INVALID_MESSAGE' + message = 'CORRUPT_MESSAGE' description = ('This message has failed its CRC checksum, exceeds the' ' valid size, or is otherwise corrupt.') +# Backward compatibility +InvalidMessageError = CorruptRecordException + class UnknownTopicOrPartitionError(BrokerResponseError): errno = 3 -- cgit v1.2.1