Entity Id None Error¶
entity_id_none_error
¶
Error raised when an entity ID is None but should not be.
Defines EntityIdNoneError, raised when code attempts to use an identityless
entity in a context that requires a defined identifier.
Extends ValueErrorMixin and Error[MetadataValueType].
EntityIdNoneError
¶
Bases: ValueErrorMixin, Error[MetadataValueType]
Raised when an entity ID is None but must be set.
Entities require an identity for correctness: an entity with
id=None cannot participate in equality comparisons, hash-based
collections, or identity lookups. This error fires at the point
where code attempts to use an identityless entity in a context that
requires a defined identifier.
Example
Source code in src/forging_blocks/domain/errors/entity_id_none_error.py
__init__(entity_class_name: str) -> None
¶
Initialise with the class name of the identityless entity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entity_class_name
|
str
|
The |
required |