diff options
author | Frederick Yin <fkfd@fkfd.me> | 2021-10-29 14:51:57 +0800 |
---|---|---|
committer | Frederick Yin <fkfd@fkfd.me> | 2021-10-29 14:51:57 +0800 |
commit | 063f3b19289f353ec57f904f700fc5567a4584ba (patch) | |
tree | ef321123c03b314163c294902cd671bf96f06ff3 /jimbrella | |
parent | cc1dade8f969e0b15211410dfa510ed9cc34104c (diff) |
Define TenantIdentityError
Diffstat (limited to 'jimbrella')
-rw-r--r-- | jimbrella/exceptions.py | 10 |
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.""" |