Repository Errors¶
repository_errors
¶
RepositoryPort error classes for the infrastructure layer.
Provides structured error types for repository operations such as
save failures, deletion of non-existent aggregates, and retrieval errors.
RepositoryError
¶
Bases: Error[dict[str, object]]
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.
Source code in src/forging_blocks/infrastructure/errors/repository_errors.py
RepositoryNotFoundError
¶
Bases: RepositoryError
Error raised when attempting to delete or retrieve an aggregate that does not exist.
Source code in src/forging_blocks/infrastructure/errors/repository_errors.py
for_id(entity_id: object) -> RepositoryNotFoundError
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
|
A RepositoryNotFoundError with a descriptive message. |