Repository Errors¶
repository_errors
¶
Error classes for repository-level storage operations.
Provides structured error types for save failures, deletion of
non-existent aggregates, and retrieval errors.
RepositoryError
¶
Bases: RuntimeErrorMixin, Error[MetadataValueType]
Generic error raised when a repository operation fails.
This is the base error for all repository-level failures. Concrete
implementations may raise this or more specific subclasses.
Example
Source code in src/forging_blocks/infrastructure/errors/repository_errors.py
RepositoryNotFoundError
¶
Bases: RepositoryError[MetadataValueType]
Error raised when attempting to delete or retrieve an aggregate that does not exist.
Example
Source code in src/forging_blocks/infrastructure/errors/repository_errors.py
for_id(entity_id: object) -> RepositoryNotFoundError[MetadataValueType]
classmethod
¶
Create an error for a specific missing aggregate ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entity_id
|
object
|
The identifier that was not found. |
required |
Returns:
| Type | Description |
|---|---|
RepositoryNotFoundError[MetadataValueType]
|
A RepositoryNotFoundError with a descriptive message. |