diff options
| author | Georgios Andreadis <info@gandreadis.com> | 2020-06-24 09:13:09 +0200 |
|---|---|---|
| committer | Georgios Andreadis <info@gandreadis.com> | 2020-06-24 09:13:09 +0200 |
| commit | bae760a62fc6a480fbe615dff6a7de03c7fd6d1d (patch) | |
| tree | 06fc47f9922add14a3ac50fcfdfeb3d4fdc00363 /opendc/util/exceptions.py | |
| parent | 6fdb3e75dad15523d996e457c216647755b29101 (diff) | |
Add formatter
Diffstat (limited to 'opendc/util/exceptions.py')
| -rw-r--r-- | opendc/util/exceptions.py | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/opendc/util/exceptions.py b/opendc/util/exceptions.py index 8eea268a..caf6dd8e 100644 --- a/opendc/util/exceptions.py +++ b/opendc/util/exceptions.py @@ -27,11 +27,8 @@ class ForeignKeyError(Exception): class RowNotFoundError(Exception): """Raised when a database row is not found.""" - def __init__(self, table_name): - super(RowNotFoundError, self).__init__( - 'Row in `{}` table not found.'.format(table_name) - ) + super(RowNotFoundError, self).__init__('Row in `{}` table not found.'.format(table_name)) self.table_name = table_name @@ -42,14 +39,9 @@ class ParameterError(Exception): class IncorrectParameterError(ParameterError): """Raised when a parameter is of the wrong type.""" - def __init__(self, parameter_name, parameter_location): - super(IncorrectParameterError, self).__init__( - 'Incorrectly typed `{}` {} parameter.'.format( - parameter_name, - parameter_location - ) - ) + super(IncorrectParameterError, + self).__init__('Incorrectly typed `{}` {} parameter.'.format(parameter_name, parameter_location)) self.parameter_name = parameter_name self.parameter_location = parameter_location @@ -57,14 +49,9 @@ class IncorrectParameterError(ParameterError): class MissingParameterError(ParameterError): """Raised when a parameter is missing.""" - def __init__(self, parameter_name, parameter_location): - super(MissingParameterError, self).__init__( - 'Missing required `{}` {} parameter.'.format( - parameter_name, - parameter_location - ) - ) + super(MissingParameterError, + self).__init__('Missing required `{}` {} parameter.'.format(parameter_name, parameter_location)) self.parameter_name = parameter_name self.parameter_location = parameter_location |
