summaryrefslogtreecommitdiff
path: root/jimbrella
diff options
context:
space:
mode:
authorFrederick Yin <fkfd@fkfd.me>2021-10-29 14:51:57 +0800
committerFrederick Yin <fkfd@fkfd.me>2021-10-29 14:51:57 +0800
commit063f3b19289f353ec57f904f700fc5567a4584ba (patch)
treeef321123c03b314163c294902cd671bf96f06ff3 /jimbrella
parentcc1dade8f969e0b15211410dfa510ed9cc34104c (diff)
Define TenantIdentityError
Diffstat (limited to 'jimbrella')
-rw-r--r--jimbrella/exceptions.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/jimbrella/exceptions.py b/jimbrella/exceptions.py
index c0cc055..498c6c4 100644
--- a/jimbrella/exceptions.py
+++ b/jimbrella/exceptions.py
@@ -27,6 +27,16 @@ class UmbrellaValueError(Exception):
super().__init__(self.message)
+class TenantIdentityError(Exception):
+ """For when a tenant attempts to return an umbrella that's borrowed by another tenant."""
+
+ def __init__(self, expected, got):
+ self.expected = expected
+ self.got = got
+ self.message = f"Umbrella is borrowed by {expected} and {got} cannot return it."
+ super().__init__(self.message)
+
+
class UsernameTakenError(Exception):
"""For when a username to be registered with is already taken."""