on_chain_error() — langchain Function Reference
Architecture documentation for the on_chain_error() function in base.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 6071fd13_110e_a9c7_7fe7_393fad76004d["on_chain_error()"] 0f6b3261_31fa_c34e_ca33_cb141bdf78ff["BaseTracer"] 6071fd13_110e_a9c7_7fe7_393fad76004d -->|defined in| 0f6b3261_31fa_c34e_ca33_cb141bdf78ff 72140908_8740_79fb_ea23_239b2c6ed1e4["on_chain_error()"] 72140908_8740_79fb_ea23_239b2c6ed1e4 -->|calls| 6071fd13_110e_a9c7_7fe7_393fad76004d 9191b24f_a202_df21_16c5_e2608083aef8["_end_trace()"] 6071fd13_110e_a9c7_7fe7_393fad76004d -->|calls| 9191b24f_a202_df21_16c5_e2608083aef8 98f0a033_64cf_a17e_a844_59b5893be0a4["_on_chain_error()"] 6071fd13_110e_a9c7_7fe7_393fad76004d -->|calls| 98f0a033_64cf_a17e_a844_59b5893be0a4 72140908_8740_79fb_ea23_239b2c6ed1e4["on_chain_error()"] 6071fd13_110e_a9c7_7fe7_393fad76004d -->|calls| 72140908_8740_79fb_ea23_239b2c6ed1e4 style 6071fd13_110e_a9c7_7fe7_393fad76004d fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/langchain_core/tracers/base.py lines 315–341
def on_chain_error(
self,
error: BaseException,
*,
inputs: dict[str, Any] | None = None,
run_id: UUID,
**kwargs: Any,
) -> Run:
"""Handle an error for a chain run.
Args:
error: The error.
inputs: The inputs for the chain.
run_id: The run ID.
**kwargs: Additional arguments.
Returns:
The run.
"""
chain_run = self._errored_chain_run(
error=error,
run_id=run_id,
inputs=inputs,
)
self._end_trace(chain_run)
self._on_chain_error(chain_run)
return chain_run
Domain
Subdomains
Defined In
Called By
Source
Frequently Asked Questions
What does on_chain_error() do?
on_chain_error() is a function in the langchain codebase, defined in libs/core/langchain_core/tracers/base.py.
Where is on_chain_error() defined?
on_chain_error() is defined in libs/core/langchain_core/tracers/base.py at line 315.
What does on_chain_error() call?
on_chain_error() calls 3 function(s): _end_trace, _on_chain_error, on_chain_error.
What calls on_chain_error()?
on_chain_error() is called by 1 function(s): on_chain_error.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free