Source code for ecstask.osp_eventhandler_v2.exceptions.configuration_exception
[docs]class ApplicationConfigurationException(Exception):
"""Base class for configuration exceptions"""
pass
[docs]class FlaskConfigurationFileNotFoundError(ApplicationConfigurationException):
"""Exception raised when the path to the file is wrong or the file is not present.
Attributes:
message (String): explanation of the error
"""
[docs] def __init__(self, message='The flask configuration file path is incorrect or the file does not exist'):
self.message = message
[docs]class FlaskConfigurationKeyError(ApplicationConfigurationException):
"""Exception raised when the provided config does not contain a required key-value pair.
Attributes:
missing_key_name (String): The Key that is missing from the configuration
"""
[docs] def __init__(self, missing_key_name):
self.message = 'The required key {} is not present in the config'.format(missing_key_name)