Home / Function/ on_chain_error() — langchain Function Reference

on_chain_error() — langchain Function Reference

Architecture documentation for the on_chain_error() function in base.py from the langchain codebase.

Function python Observability Tracers calls 3 called by 1

Entity Profile

Dependency Diagram

graph TD
  72140908_8740_79fb_ea23_239b2c6ed1e4["on_chain_error()"]
  b3ab8001_c14c_4191_ca53_2dbabc99917f["AsyncBaseTracer"]
  72140908_8740_79fb_ea23_239b2c6ed1e4 -->|defined in| b3ab8001_c14c_4191_ca53_2dbabc99917f
  6071fd13_110e_a9c7_7fe7_393fad76004d["on_chain_error()"]
  6071fd13_110e_a9c7_7fe7_393fad76004d -->|calls| 72140908_8740_79fb_ea23_239b2c6ed1e4
  a962822f_f5be_755c_cef6_a8eeb2b06eb5["_end_trace()"]
  72140908_8740_79fb_ea23_239b2c6ed1e4 -->|calls| a962822f_f5be_755c_cef6_a8eeb2b06eb5
  98f0a033_64cf_a17e_a844_59b5893be0a4["_on_chain_error()"]
  72140908_8740_79fb_ea23_239b2c6ed1e4 -->|calls| 98f0a033_64cf_a17e_a844_59b5893be0a4
  6071fd13_110e_a9c7_7fe7_393fad76004d["on_chain_error()"]
  72140908_8740_79fb_ea23_239b2c6ed1e4 -->|calls| 6071fd13_110e_a9c7_7fe7_393fad76004d
  style 72140908_8740_79fb_ea23_239b2c6ed1e4 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/tracers/base.py lines 727–741

    async def on_chain_error(
        self,
        error: BaseException,
        *,
        inputs: dict[str, Any] | None = None,
        run_id: UUID,
        **kwargs: Any,
    ) -> None:
        chain_run = self._errored_chain_run(
            error=error,
            inputs=inputs,
            run_id=run_id,
        )
        tasks = [self._end_trace(chain_run), self._on_chain_error(chain_run)]
        await asyncio.gather(*tasks)

Domain

Subdomains

Called By

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 727.
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