Source code for eventbus.domain.exceptions

# -*- coding: utf-8 -*-
[docs]class DomainEventError(Exception): """Base eventsourcing exception."""
[docs]class TopicResolutionError(DomainEventError): """Raised when unable to resolve a topic to a Python class."""
[docs]class ConsistencyError(DomainEventError): """Raised when applying an event stream to a versioned entity."""
[docs]class MismatchedOriginatorError(ConsistencyError): """Raised when applying an event to an inappropriate object."""
[docs]class OriginatorIDError(MismatchedOriginatorError): """Raised when applying an event to the wrong entity or aggregate."""
[docs]class OriginatorVersionError(MismatchedOriginatorError): """Raised when applying an event to the wrong version of an entity or aggregate."""
[docs]class EntityIsDiscarded(AssertionError): """Raised when access to a recently discarded entity object is attempted."""
[docs]class EncoderTypeError(TypeError): pass