class ConfigurationError(Exception): pass class AuthError(Exception): def __init__(self, error, status_code=401): self.error = error self.status_code = status_code class InvalidInputError(Exception): def __init__(self, error, status_code=400): self.error = error self.status_code = status_code class ApplicationError(Exception): """Generic application error for covering any unhandled exceptions""" def __init__(self, error, status_code=500): self.error = error self.status_code = status_code class FeatureNotImplementedError(Exception): """Generic application error for covering any unhandled exceptions""" def __init__(self, error, status_code=501): self.error = error self.status_code = status_code class ItemNotFoundError(Exception): """Item not found""" def __init__(self, error, status_code=404): self.error = error self.status_code = status_code class BigTableError(ApplicationError): """Generic Google BigTable error for covering major exceptions""" class ProtoBinaryAttributeError(ApplicationError): """Unable to deserialize value for protocol buffer binary string""" class ProtoAttributeError(ApplicationError): """Unable to deserialize value for protocol buffer binary string""" class RangeError(InvalidInputError): """Used for invalid ranges (e.g.: start < end)""" class InvalidDataError(Exception): """The data does not match what we expected""" class MissingRequiredParameterError(Exception): """Missing a required parameter. This is an internal exception for developers only.""" class ExternalServiceError(ApplicationError): """An exception was raised due to an external dependency"""