Source code for smif.exception
"""Holds custom smif exception hierarchy
Exception
+-- SmifException
+-- SmifDataError
+-- SmifDataNotFoundError
+-- SmifDataExistsError
+-- SmifDataMismatchError
+-- SmifDataReadError
+-- SmifDataInputError
+-- SmifModelRunError
+-- SmifValidationError
"""
[docs]class SmifException(Exception):
"""The base class for all errors raised in smif"""
pass
[docs]class SmifDataError(SmifException):
"""Errors raised by the Store"""
pass
[docs]class SmifDataNotFoundError(SmifDataError):
"""Raise when some data is not found"""
pass
[docs]class SmifDataExistsError(SmifDataError):
"""Raise when some data is found unexpectedly"""
pass
[docs]class SmifDataMismatchError(SmifDataError):
"""Raise when some data doesn't match the context
E.g. when updating an object by id, the updated object's id must match
the id provided separately.
"""
pass
[docs]class SmifDataReadError(SmifDataError):
"""Raise when unable to read data
E.g. unable to handle file type or connect to database
"""
pass
[docs]class SmifModelRunError(SmifException):
"""Raise when model run requirements are not satisfied"""
pass
[docs]class SmifValidationError(SmifException):
"""Custom exception to use for parsing validation."""
pass
[docs]class SmifTimestepResolutionError(SmifException):
"""Raise when timestep cannot be resolved"""
pass