summaryrefslogtreecommitdiff
path: root/kafka/errors.py
diff options
context:
space:
mode:
authorTaras <voyn1991@gmail.com>2017-10-10 00:13:16 +0300
committerTaras <voyn1991@gmail.com>2017-10-11 18:09:17 +0300
commitfbea5f04bccd28f3aa15a1711548b131504591ac (patch)
tree1c8a0efe687c2ace72fa146b4f03e15def8e3a95 /kafka/errors.py
parentf04435c5ed97fef0975a77a8dc7bae7c284bba63 (diff)
downloadkafka-python-fbea5f04bccd28f3aa15a1711548b131504591ac.tar.gz
Refactor MessageSet and Message into LegacyRecordBatch to later support v2 message format
Diffstat (limited to 'kafka/errors.py')
-rw-r--r--kafka/errors.py7
1 files changed, 5 insertions, 2 deletions
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