Skip to content

errors.py

PyCelonisDataExportNotEnabledError (PyCelonisError)

Raised when data export not enabled.

Source code in celonis_api/errors.py
class PyCelonisDataExportNotEnabledError(PyCelonisError):
    """Raised when data export not enabled."""

    def __init__(self, message: str):
        """Instantiates PyCelonisDataExportNotEnabledError with data export not enabled error message."""
        super(PyCelonisDataExportNotEnabledError, self).__init__(
            message=f"Data Export not enabled. Please contact Celonis customer support.\n{message}".strip()
        )

__init__(self, message) special

Instantiates PyCelonisDataExportNotEnabledError with data export not enabled error message.

Source code in celonis_api/errors.py
def __init__(self, message: str):
    """Instantiates PyCelonisDataExportNotEnabledError with data export not enabled error message."""
    super(PyCelonisDataExportNotEnabledError, self).__init__(
        message=f"Data Export not enabled. Please contact Celonis customer support.\n{message}".strip()
    )

PyCelonisError (Exception)

Base Error class.

Source code in celonis_api/errors.py
class PyCelonisError(Exception):
    """Base Error class."""

    def __init__(self, message: typing.Optional[str] = None) -> None:
        _tracker = PyCelonisTracker()
        if _tracker.enabled:
            _tracker.error(message, extra={"tracking_type": "ERROR", "level": "error"})
            message = f"{message}\n[Celonis Support ID: {_tracker.support_id}]"

        self.message = message
        super().__init__(self.message)

PyCelonisHTTPError (PyCelonisError, HTTPError)

Raised when HTTP error occurred.

Source code in celonis_api/errors.py
class PyCelonisHTTPError(PyCelonisError, HTTPError):
    """Raised when HTTP error occurred."""

    def __init__(self, message: str, response: Response = None) -> None:
        super(PyCelonisHTTPError, self).__init__(message)
        self.response = response

__init__(self, message, response=None) special

Initialize RequestException with request and response objects.

Source code in celonis_api/errors.py
def __init__(self, message: str, response: Response = None) -> None:
    super(PyCelonisHTTPError, self).__init__(message)
    self.response = response

PyCelonisNotFoundError (PyCelonisError)

Raised when object with given id was not found.

Source code in celonis_api/errors.py
class PyCelonisNotFoundError(PyCelonisError):
    """Raised when object with given id was not found."""

PyCelonisNotImplementedError (PyCelonisError)

Raised when method is not implemented.

Source code in celonis_api/errors.py
class PyCelonisNotImplementedError(PyCelonisError):
    """Raised when method is not implemented."""

PyCelonisNotSupportedError (PyCelonisError)

Raised when an operation is not supported by the underlying structure.

Source code in celonis_api/errors.py
class PyCelonisNotSupportedError(PyCelonisError):
    """Raised when an operation is not supported by the underlying structure."""

PyCelonisPermissionError (PyCelonisError)

Raised when USER or API token has not enough permissions.

Source code in celonis_api/errors.py
class PyCelonisPermissionError(PyCelonisError):
    """Raised when USER or API token has not enough permissions."""

PyCelonisTypeError (PyCelonisError)

Raised when using the wrong type.

Source code in celonis_api/errors.py
class PyCelonisTypeError(PyCelonisError):
    """Raised when using the wrong type."""

    def __init__(self, message: str) -> None:
        message = f"Unsupported type! {message}"
        super().__init__(message)

PyCelonisValueError (PyCelonisError)

Raised when using wrong value.

Source code in celonis_api/errors.py
class PyCelonisValueError(PyCelonisError):
    """Raised when using wrong value."""