summaryrefslogtreecommitdiff
path: root/jimbrella
diff options
context:
space:
mode:
Diffstat (limited to 'jimbrella')
-rw-r--r--jimbrella/exceptions.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/jimbrella/exceptions.py b/jimbrella/exceptions.py
index ad92b50..c0cc055 100644
--- a/jimbrella/exceptions.py
+++ b/jimbrella/exceptions.py
@@ -25,3 +25,12 @@ class UmbrellaValueError(Exception):
self.field = field
self.message = f"Invalid field: {field}."
super().__init__(self.message)
+
+
+class UsernameTakenError(Exception):
+ """For when a username to be registered with is already taken."""
+
+ def __init__(self, username: str):
+ self.username = username
+ self.message = f"Username {username} is already taken."
+ super().__init__(self.message)