Error handling
Utilities for handling errors and error contexts in the pipeline.
This module provides utilities for standardized error handling across the pipeline system.
References
NONE
ErrorContext
Bases: BaseModel
Standardized error context for pipeline steps.
This model provides a structured way to represent error context information for pipeline steps, ensuring consistency in error messages across the pipeline.
Attributes:
Name | Type | Description |
---|---|---|
exception |
BaseException
|
The exception that was raised |
step_name |
str
|
The name of the pipeline step where the error occurred |
step_type |
str
|
The type of pipeline step where the error occurred |
state |
dict[str, Any] | None
|
The pipeline state at the time of the error. Defaults to None. |
operation |
str
|
Description of the operation being performed when the error occurred. Defaults to "execution". |
additional_context |
str | None
|
Additional context to include in the error message. Defaults to None. |
__str__()
Convert the error context to a human-readable string.
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
A formatted error message string |
ValidationError(message)
Bases: Exception
Exception raised for errors in state validation.
This exception is raised when input validation fails in pipeline steps. It provides more specific error information than a generic RuntimeError.
Attributes:
Name | Type | Description |
---|---|---|
message |
str
|
The error message explaining the validation failure |
Initialize with an error message.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message |
str
|
The error message explaining what validation failed |
required |