on_chain_error(
self,
error: BaseException,
*,
run_id: UUID,
parent_run_id: Optional[| Name | Type | Description |
|---|---|---|
error* | BaseException | The exception that was raised. |
run_id* | UUID | Unique identifier for this run. |
parent_run_id | Optional[UUID] | Default: NoneRun ID of the parent chain, if any. |
**kwargs | Any | Default: {} |
Handle errors raised during chain execution.
Records the error type and message on the span, sets
StatusCode.ERROR, and propagates accumulated token usage before
closing the span.
Additional LangChain callback keyword arguments.