summaryrefslogtreecommitdiff
path: root/common/src/leap
diff options
context:
space:
mode:
authordrebs <drebs@leap.se>2014-01-07 11:05:39 -0200
committerdrebs <drebs@leap.se>2014-01-07 11:05:39 -0200
commit82628d8284c5c11452da75a6604f2f68b8dd8520 (patch)
tree2e7280c065301306611fd60d614111c19e43acaa /common/src/leap
parentf98f66549d6762bbfc072ef6afe0057798a4da27 (diff)
Use temp dir for server side locks (#4918).
Diffstat (limited to 'common/src/leap')
-rw-r--r--common/src/leap/soledad/common/errors.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/common/src/leap/soledad/common/errors.py b/common/src/leap/soledad/common/errors.py
index 62de19f8..c41e0b0f 100644
--- a/common/src/leap/soledad/common/errors.py
+++ b/common/src/leap/soledad/common/errors.py
@@ -67,10 +67,19 @@ class LockTimedOutError(errors.U1DBError):
status = 408
+class CouldNotObtainLockError(errors.U1DBError):
+ """
+ Exception raised when timing out while trying to lock the shared database.
+ """
+
+ wire_description = "error obtaining lock"
+ status = 500
+
+
# update u1db "wire description to status" and "wire description to exception"
# maps.
for e in [InvalidTokenError, NotLockedError, AlreadyLockedError,
- LockTimedOutError]:
+ LockTimedOutError, CouldNotObtainLockError]:
http_errors.wire_description_to_status.update({
e.wire_description: e.status})
errors.wire_description_to_exc.update({