MCPcopy
hub / github.com/langchain-ai/langchain / on_tool_error

Method on_tool_error

libs/core/langchain_core/tracers/base.py:279–293  ·  view source on GitHub ↗

Handle an error for a tool run.

(
        self,
        error: BaseException,
        *,
        run_id: UUID,
        **kwargs: Any,
    )

Source from the content-addressed store, hash-verified

277 return tool_run
278
279 def on_tool_error(
280 self,
281 error: BaseException,
282 *,
283 run_id: UUID,
284 **kwargs: Any,
285 ) -> Run:
286 """Handle an error for a tool run."""
287 tool_run = self._errored_tool_run(
288 error=error,
289 run_id=run_id,
290 )
291 self._end_trace(tool_run)
292 self._on_tool_error(tool_run)
293 return tool_run
294
295 def on_retriever_start(
296 self,

Callers 2

runMethod · 0.45
arunMethod · 0.45

Calls 3

_end_traceMethod · 0.95
_errored_tool_runMethod · 0.80
_on_tool_errorMethod · 0.45

Tested by

no test coverage detected