Skip to content

Event Store Error

event_store_error

Base error for event persistence operations.

Defines EventStoreError, raised when append, read, or snapshot
operations on the event store fail. Extends RuntimeErrorMixin,
making it catchable as RuntimeError.

EventStoreError

Bases: RuntimeErrorMixin, Error[MetadataValueType]

Base error for event persistence operations.

Raised when append, read, or snapshot operations on the event
store fail. Extends RuntimeErrorMixin, making it catchable
as RuntimeError.

Example
error = EventStoreError("Failed to append events to event stream")
raise error
Source code in src/forging_blocks/application/errors/event_store_error.py
class EventStoreError[MetadataValueType = object](RuntimeErrorMixin, Error[MetadataValueType]):
    """Base error for event persistence operations.

    Raised when append, read, or snapshot operations on the event
    store fail. Extends ``RuntimeErrorMixin``, making it catchable
    as ``RuntimeError``.

    Example:
        ```python
        error = EventStoreError("Failed to append events to event stream")
        raise error
        ```

    """

    def __init__(self, message: str) -> None:
        super().__init__(ErrorMessage(message))