summaryrefslogtreecommitdiff
path: root/kafka/errors.py
diff options
context:
space:
mode:
authorDana Powers <dana.powers@gmail.com>2017-03-03 17:27:54 -0800
committerDana Powers <dana.powers@gmail.com>2017-03-04 10:52:44 -0800
commitffbfd29da003b7fb4ccecc7c7f7fc3fc2a3076bd (patch)
treebd5dc4d08fcb4f52a28bc9f6e3c9279253759141 /kafka/errors.py
parentccbdf592c16ca46bfdca3fbde268affc66fdca34 (diff)
downloadkafka-python-ffbfd29da003b7fb4ccecc7c7f7fc3fc2a3076bd.tar.gz
Add new broker response errors
Diffstat (limited to 'kafka/errors.py')
-rw-r--r--kafka/errors.py65
1 files changed, 65 insertions, 0 deletions
diff --git a/kafka/errors.py b/kafka/errors.py
index 72e9b1f..8fcaf59 100644
--- a/kafka/errors.py
+++ b/kafka/errors.py
@@ -349,6 +349,71 @@ class IllegalSaslStateError(BrokerResponseError):
description = 'Request is not valid given the current SASL state.'
+class UnsupportedVersionError(BrokerResponseError):
+ errno = 35
+ message = 'UNSUPPORTED_VERSION'
+ description = 'The version of API is not supported.'
+
+
+class TopicAlreadyExistsError(BrokerResponseError):
+ errno = 36
+ message = 'TOPIC_ALREADY_EXISTS'
+ description = 'Topic with this name already exists.'
+
+
+class InvalidPartitionsError(BrokerResponseError):
+ errno = 37
+ message = 'INVALID_PARTITIONS'
+ description = 'Number of partitions is invalid.'
+
+
+class InvalidReplicationFactorError(BrokerResponseError):
+ errno = 38
+ message = 'INVALID_REPLICATION_FACTOR'
+ description = 'Replication-factor is invalid.'
+
+
+class InvalidReplicationAssignmentError(BrokerResponseError):
+ errno = 39
+ message = 'INVALID_REPLICATION_ASSIGNMENT'
+ description = 'Replication assignment is invalid.'
+
+
+class InvalidConfigurationError(BrokerResponseError):
+ errno = 40
+ message = 'INVALID_CONFIG'
+ description = 'Configuration is invalid.'
+
+
+class NotControllerError(BrokerResponseError):
+ errno = 41
+ message = 'NOT_CONTROLLER'
+ description = 'This is not the correct controller for this cluster.'
+ retriable = True
+
+
+class InvalidRequestError(BrokerResponseError):
+ errno = 42
+ message = 'INVALID_REQUEST'
+ description = ('This most likely occurs because of a request being'
+ ' malformed by the client library or the message was'
+ ' sent to an incompatible broker. See the broker logs'
+ ' for more details.')
+
+
+class UnsupportedForMessageFormatError(BrokerResponseError):
+ errno = 43
+ message = 'UNSUPPORTED_FOR_MESSAGE_FORMAT'
+ description = ('The message format version on the broker does not'
+ ' support this request.')
+
+
+class PolicyViolationError(BrokerResponseError):
+ errno = 44
+ message = 'POLICY_VIOLATION'
+ description = 'Request parameters do not satisfy the configured policy.'
+
+
class KafkaUnavailableError(KafkaError):
pass