Error¶
error
¶
Fundamental error class for the Building Blocks framework.
Defines the base Error type that all structured errors inherit from.
Error
¶
Bases: Exception, Debuggable
Base class for all structured errors that can be raised like standard Exceptions.
Source code in src/forging_blocks/foundation/errors/error.py
message: ErrorMessage
property
¶
Structured error message.
metadata: ErrorMetadata[MetadataType]
property
¶
Structured metadata with additional context.
context: MetadataType
property
¶
Shortcut for accessing the metadata context.
__init__(message: ErrorMessage, metadata: ErrorMetadata[MetadataType] | None = None) -> None
¶
Initialise the error with a structured message and optional metadata.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message
|
ErrorMessage
|
The structured error message describing what went wrong. |
required |
metadata
|
ErrorMetadata[MetadataType] | None
|
Optional structured metadata with additional diagnostic |
None
|
Source code in src/forging_blocks/foundation/errors/error.py
as_debug_string() -> str
¶
Return a detailed, multi-line string for debugging.