Source code for mantlebio.exceptions
# All exceptions should subclass from MantlebioError in this module.
[docs]
class MantlebioError(Exception):
"""Base class for all Mantlebio errors."""
pass
[docs]
class MantleAuthenticationError(MantlebioError):
pass
[docs]
class MantleConfigurationError(MantlebioError):
pass
[docs]
class MantleInvalidParameterError(MantlebioError):
pass
[docs]
class MantleMissingParameterError(MantlebioError):
pass
[docs]
class MantleClientError(MantlebioError):
pass
[docs]
class MantleTypeError(MantlebioError):
def __init__(self, type ) -> None:
super().__init__(f"Invalid type {type}")
[docs]
class StorageUploadError(MantlebioError):
pass
[docs]
class MantleResourceNotFoundError(MantlebioError):
def __init__(self, request_url, response_content):
super().__init__(f"Resource not found: {request_url} got response: {response_content}")
[docs]
class MantleRetriesExceededError(MantlebioError):
def __init__(self, last_exception, msg='Max Retries Exceeded'):
super().__init__(msg)
self.last_exception = last_exception
[docs]
class MantleQueryBuilderError(MantlebioError):
def __init__(self, msg):
super().__init__(msg)
[docs]
class MantleApiError(MantlebioError):
pass
[docs]
class MantleProtoError(MantlebioError):
def __init__(self, content, proto):
super().__init__(f"Failed to parse response as {proto}. Response: {content}")
[docs]
class MantleResponseError(MantlebioError):
pass
[docs]
class MantleAttributeError(MantlebioError):
pass
[docs]
class MantlebioWarning(Warning):
"""
Warning for Mantle API related issues.
"""
pass
[docs]
class MantleConfigurationWarning(MantlebioWarning):
"""
Warning for Mantle configuration issues.
"""
pass
[docs]
class PythonDeprecationWarning(Warning):
"""
Python version being used is scheduled to become unsupported
in an future release. See warning for specifics.
"""
pass