_on_chain_error() — langchain Function Reference
Architecture documentation for the _on_chain_error() function in langchain.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD bd21d245_281c_d787_ba7a_a842618eec60["_on_chain_error()"] 178590bb_85ff_b79e_979a_46e5c3c5389f["LangChainTracer"] bd21d245_281c_d787_ba7a_a842618eec60 -->|defined in| 178590bb_85ff_b79e_979a_46e5c3c5389f cf43defe_cb35_deb4_9782_55f973cdf6ca["_persist_run_single()"] bd21d245_281c_d787_ba7a_a842618eec60 -->|calls| cf43defe_cb35_deb4_9782_55f973cdf6ca bce3427a_d6ea_f317_a362_d28206fa1696["_update_run_single()"] bd21d245_281c_d787_ba7a_a842618eec60 -->|calls| bce3427a_d6ea_f317_a362_d28206fa1696 style bd21d245_281c_d787_ba7a_a842618eec60 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/langchain_core/tracers/langchain.py lines 337–344
def _on_chain_error(self, run: Run) -> None:
"""Process the Chain Run upon error."""
# If inputs were deferred, persist (POST) the run now that inputs are realized.
# Otherwise, update (PATCH) the existing run.
if run.extra.get("defers_inputs"):
self._persist_run_single(run)
else:
self._update_run_single(run)
Domain
Subdomains
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/langchain.py.
Where is _on_chain_error() defined?
_on_chain_error() is defined in libs/core/langchain_core/tracers/langchain.py at line 337.
What does _on_chain_error() call?
_on_chain_error() calls 2 function(s): _persist_run_single, _update_run_single.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free