Remove instances of 'raise Exception' (#7523)

This commit is contained in:
Edward Oakes
2020-03-10 17:51:22 -07:00
committed by GitHub
parent fdb528514b
commit 7b609ca211
13 changed files with 134 additions and 131 deletions
+6 -6
View File
@@ -141,8 +141,8 @@ class Cluster:
exception.
Raises:
Exception: An exception is raised if the timeout expires before the
node appears in the client table.
TimeoutError: An exception is raised if the timeout expires before
the node appears in the client table.
"""
ip_address, port = self.redis_address.split(":")
redis_client = redis.StrictRedis(
@@ -158,7 +158,7 @@ class Cluster:
return
else:
time.sleep(0.1)
raise Exception("Timed out while waiting for nodes to join.")
raise TimeoutError("Timed out while waiting for nodes to join.")
def wait_for_nodes(self, timeout=30):
"""Waits for correct number of nodes to be registered.
@@ -174,8 +174,8 @@ class Cluster:
before failing.
Raises:
Exception: An exception is raised if we time out while waiting for
nodes to join.
TimeoutError: An exception is raised if we time out while waiting
for nodes to join.
"""
ip_address, port = self.address.split(":")
redis_client = redis.StrictRedis(
@@ -195,7 +195,7 @@ class Cluster:
"{} nodes are currently registered, but we are expecting "
"{}".format(len(live_clients), expected))
time.sleep(0.1)
raise Exception("Timed out while waiting for nodes to join.")
raise TimeoutError("Timed out while waiting for nodes to join.")
def list_all_nodes(self):
"""Lists all nodes.