diff options
author | Anas <anas.el.amraoui@live.com> | 2021-11-30 18:05:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-30 18:05:51 +0200 |
commit | b94e230b17d08e6c89d134e933c706256b79bc4a (patch) | |
tree | 993bd7565169229326b810b66939587431ab9dc6 /redis/exceptions.py | |
parent | 368a25f9d163d784a8896f1c087582405e98e006 (diff) | |
download | redis-py-b94e230b17d08e6c89d134e933c706256b79bc4a.tar.gz |
Added black and isort (#1734)
Diffstat (limited to 'redis/exceptions.py')
-rw-r--r-- | redis/exceptions.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/redis/exceptions.py b/redis/exceptions.py index eb6ecc2..e37cad3 100644 --- a/redis/exceptions.py +++ b/redis/exceptions.py @@ -83,6 +83,7 @@ class AuthenticationWrongNumberOfArgsError(ResponseError): An error to indicate that the wrong number of args were sent to the AUTH command """ + pass @@ -90,6 +91,7 @@ class RedisClusterException(Exception): """ Base exception for the RedisCluster client """ + pass @@ -98,6 +100,7 @@ class ClusterError(RedisError): Cluster errors occurred multiple times, resulting in an exhaustion of the command execution TTL """ + pass @@ -111,6 +114,7 @@ class ClusterDownError(ClusterError, ResponseError): unavailable. It automatically returns available as soon as all the slots are covered again. """ + def __init__(self, resp): self.args = (resp,) self.message = resp @@ -135,8 +139,8 @@ class AskError(ResponseError): """should only redirect to master node""" self.args = (resp,) self.message = resp - slot_id, new_node = resp.split(' ') - host, port = new_node.rsplit(':', 1) + slot_id, new_node = resp.split(" ") + host, port = new_node.rsplit(":", 1) self.slot_id = int(slot_id) self.node_addr = self.host, self.port = host, int(port) @@ -147,6 +151,7 @@ class TryAgainError(ResponseError): Operations on keys that don't exist or are - during resharding - split between the source and destination nodes, will generate a -TRYAGAIN error. """ + def __init__(self, *args, **kwargs): pass @@ -157,6 +162,7 @@ class ClusterCrossSlotError(ResponseError): A CROSSSLOT error is generated when keys in a request don't hash to the same slot. """ + message = "Keys in request don't hash to the same slot" @@ -166,6 +172,7 @@ class MovedError(AskError): A request sent to a node that doesn't serve this key will be replayed with a MOVED error that points to the correct node. """ + pass @@ -174,6 +181,7 @@ class MasterDownError(ClusterDownError): Error indicated MASTERDOWN error received from cluster. Link with MASTER is down and replica-serve-stale-data is set to 'no'. """ + pass @@ -185,4 +193,5 @@ class SlotNotCoveredError(RedisClusterException): If this error is raised the client should drop the current node layout and attempt to reconnect and refresh the node layout again """ + pass |