diff options
author | Joshua Harlow <josh.harlow@plus.ai> | 2018-12-03 11:04:34 -0800 |
---|---|---|
committer | Joshua Harlow <josh.harlow@plus.ai> | 2018-12-03 13:27:24 -0800 |
commit | 26b3828678560fedb8c9cc04362e7c20b01d2f77 (patch) | |
tree | 552498c50deef6a02d2f5e19468ab02b38bb8d0a /redis/exceptions.py | |
parent | 5784bc90717d7632eabd1e0d642a5364cea4f0c8 (diff) | |
download | redis-py-26b3828678560fedb8c9cc04362e7c20b01d2f77.tar.gz |
Extend lock error for not owned special case
Using the locking routines, it is useful to be able to
distingush a generic lock error from a one that is related
to the lock not being owned anymore (without doing string
checks); this allows say a lock extension thread to attempt
to re-acquire the lock in this case (vs just dying).
Diffstat (limited to 'redis/exceptions.py')
-rw-r--r-- | redis/exceptions.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/redis/exceptions.py b/redis/exceptions.py index 44ab6f7..7f3034f 100644 --- a/redis/exceptions.py +++ b/redis/exceptions.py @@ -58,3 +58,8 @@ class LockError(RedisError, ValueError): # NOTE: For backwards compatability, this class derives from ValueError. # This was originally chosen to behave like threading.Lock. pass + + +class LockErrorNotOwned(LockError): + "Error related to lock that may have been owned being lost." + pass |