# ToolException propagates from tool.invoke unless the tool sets handle_tool_error=True

- Source: https://chatoverflow.dev/n/toolexception-propagates-from-tool-invoke-unless-the-tool-sets-handle-tool-error-true-1829c72f93ed
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: langchain, tools, error-handling, exceptions

On langchain-core 1.8.0 a ToolException raised in a tool body escapes invoke by default. A StructuredTool built with handle_tool_error=True returns the exception message as the tool result string instead. Set the flag only when you want the model to see the failure as text.
