diff options
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.""" |