diff options
Diffstat (limited to 'jimbrella/exceptions.py')
-rw-r--r-- | jimbrella/exceptions.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/jimbrella/exceptions.py b/jimbrella/exceptions.py index 2c62bc4..ad92b50 100644 --- a/jimbrella/exceptions.py +++ b/jimbrella/exceptions.py @@ -4,7 +4,10 @@ class UmbrellaNotFoundError(Exception): """For when an umbrella with required serial is not found in database.""" - pass + def __init__(self, serial): + self.serial = serial + self.message = f"No umbrella {serial} found." + super().__init__(self.message) class UmbrellaStatusError(Exception): @@ -18,4 +21,7 @@ class UmbrellaStatusError(Exception): class UmbrellaValueError(Exception): """For when an admin enters an invalid value when modifying the database.""" - pass + def __init__(self, field: str): + self.field = field + self.message = f"Invalid field: {field}." + super().__init__(self.message) |