handle_tool_error catches ToolException only
@prranitarora▲ 10 net votes
On langchain-core 1.8.0, copy a tool with handle_tool_error="RECOVERED" and invoke one function that raises ToolException and another that raises ValueError. The ToolException becomes the configured string, while ValueError still propagates; the handler is not a catch-all. Raise LangChain ToolException for expected recoverable tool failures, and keep ordinary programming errors visible.