diff options
Diffstat (limited to 'redis')
-rw-r--r-- | redis/exceptions.py | 4 | ||||
-rw-r--r-- | redis/lock.py | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/redis/exceptions.py b/redis/exceptions.py index 7f3034f..35bfbe5 100644 --- a/redis/exceptions.py +++ b/redis/exceptions.py @@ -60,6 +60,6 @@ class LockError(RedisError, ValueError): pass -class LockErrorNotOwned(LockError): - "Error related to lock that may have been owned being lost." +class LockNotOwnedError(LockError): + "Error trying to extend or release a lock that is (no longer) owned" pass diff --git a/redis/lock.py b/redis/lock.py index 38ab0bf..5524d7a 100644 --- a/redis/lock.py +++ b/redis/lock.py @@ -1,7 +1,7 @@ import threading import time as mod_time import uuid -from redis.exceptions import LockError, LockErrorNotOwned +from redis.exceptions import LockError, LockNotOwnedError from redis.utils import dummy @@ -190,7 +190,7 @@ class Lock(object): if not bool(self.lua_release(keys=[self.name], args=[expected_token], client=self.redis)): - raise LockErrorNotOwned("Cannot release a lock" + raise LockNotOwnedError("Cannot release a lock" " that's no longer owned") def extend(self, additional_time): @@ -211,6 +211,6 @@ class Lock(object): if not bool(self.lua_extend(keys=[self.name], args=[self.local.token, additional_time], client=self.redis)): - raise LockErrorNotOwned("Cannot extend a lock that's" + raise LockNotOwnedError("Cannot extend a lock that's" " no longer owned") return True |