Not Callable Predicate Error¶
not_callable_predicate_error
¶
Error raised when a specification predicate is not a callable object.
Defines NotCallablePredicateError, raised when an object provided
as a specification predicate is not callable.
NotCallablePredicateError
¶
Bases: ValueErrorMixin, Error[MetadataValueType]
Exception raised when a specification predicate is not callable.
The error message includes the actual type of the predicate that was
provided, helping developers identify and fix the issue.
Attributes:
| Name | Type | Description |
|---|---|---|
message |
ErrorMessage
|
Structured error message containing the type name of the invalid predicate. |
metadata |
ErrorMetadata[MetadataValueType]
|
Optional metadata providing additional context about the error. |
context |
dict[str, MetadataValueType]
|
Shortcut access to the metadata context dictionary. |
Source code in src/forging_blocks/foundation/errors/not_callable_predicate_error.py
__init__(predicate: object) -> None
¶
Initialize the NotCallablePredicateError with the invalid predicate.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
predicate
|
object
|
The object that was provided as a predicate but is not callable. |
required |