Skip to main content

Module errors

Module errors 

Source
Expand description

Application-layer wrapper types for domain error types

These wrapper types shield the SDK’s public API from internal domain error types. They mirror the domain types structurally but live in the application layer, so SDK consumers never need to import from crate::domain.

§Design Rationale

Domain errors (RepositoryError, StateTypeError, ReleaseStep) are implementation details of the persistence and state-machine layers. Exposing them directly in the SDK’s public error surface would:

  1. Require SDK consumers to add #[allow(unused_imports)] for domain modules
  2. Make internal domain changes breaking changes for SDK consumers
  3. Violate the DDD Dependency Rule (presentation ← application, not ← domain)

The From conversions on each *CommandHandlerError use these wrappers so that application handler code using ? on domain-returning calls continues to work unchanged.

Structs§

InvalidStateError
Application-layer wrapper for domain StateTypeError.

Enums§

PersistenceError
Application-layer wrapper for domain RepositoryError.
ReleaseWorkflowStep
Application-layer representation of a release workflow step.