Source code for rail_pz_service.common.errors

"""pz-rail-service specific error types"""


[docs] class RAILIDMismatchError(ValueError): """Raised when there is an ID mismatch between row IDs"""
[docs] class RAILIntegrityError(RuntimeError): """Raised when catching a sqlalchemy.exc.IntegrityError"""
[docs] class RAILStatementError(RuntimeError): """Raised when catching a sqlalchemy.exc.StatementError"""
[docs] class RAILMissingIDError(KeyError): """Raised when no row matches the requested ID"""
[docs] class RAILMissingNameError(KeyError): """Raised when no row matches the requested name"""
[docs] class RAILMissingRowCreateInputError(AttributeError): """Raised when call to create a row is missing required information"""
[docs] class RAILImportError(ImportError): """Raised when RAIL failed to import a module"""
[docs] class RAILRequestError(RuntimeError): """Raised when a RAIL request failed"""
[docs] class RAILFileNotFoundError(FileNotFoundError): """Raised when a requested input file is not found"""
[docs] class RAILBadDatasetError(RuntimeError): """Raised when a requested input dataset fails validation checks"""
[docs] class RAILBadModelError(RuntimeError): """Raised when a requested input model fails validation checks"""
[docs] class RAILMissingInputError(FileNotFoundError): """Raised when a function is missing a required input"""
[docs] class RAILBadInputError(FileNotFoundError): """Raised when a functions input is not what is expected"""