Skip to content

Exceptions

Exception hierarchy:

ChicoryError (base)
├── TaskNotFoundError
├── ValidationError
├── RetryError
├── MaxRetriesExceededError
├── BackendNotConfiguredError
├── BrokerConnectionError
└── DbPoolExhaustedException

chicory.ChicoryError

Bases: Exception

Base exception for Chicory.

chicory.TaskNotFoundError

Bases: ChicoryError

Raised when a task is not registered.

chicory.ValidationError

Bases: ChicoryError

Raised when input/output validation fails.

chicory.RetryError

RetryError(
    retries: int | None = None,
    max_retries: int | None = None,
    countdown: float | None = None,
)

Bases: ChicoryError

Raised to trigger a task retry.

Source code in src/chicory/exceptions.py
def __init__(
    self,
    retries: int | None = None,
    max_retries: int | None = None,
    countdown: float | None = None,
):
    self.retries = retries
    self.max_retries = max_retries
    self.countdown = countdown
    super().__init__(
        f"Retry requested with countdown={countdown} "
        f"(attempt {retries}/{max_retries})"
    )

chicory.MaxRetriesExceededError

Bases: ChicoryError

Raised when max retries are exhausted.

chicory.BackendNotConfiguredError

Bases: ChicoryError

Raised when backend operations are attempted without a backend.

chicory.BrokerConnectionError

Bases: ChicoryError

Raised when broker connection fails.

chicory.DbPoolExhaustedException

DbPoolExhaustedException(message: str)

Bases: ChicoryError

Raised when the database connection pool is exhausted.

Source code in src/chicory/exceptions.py
def __init__(self, message: str):
    self.message = message
    super().__init__(message)