From 2cf0b0c342098a2d514cefc256fbc42b699bd1b7 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2025 13:27:18 +0000 Subject: [PATCH] fix: propagate ValueError for empty tool arguments Co-Authored-By: Joe Moura --- src/crewai/tools/tool_usage.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/crewai/tools/tool_usage.py b/src/crewai/tools/tool_usage.py index 3d3fe3a14..6ef104ac0 100644 --- a/src/crewai/tools/tool_usage.py +++ b/src/crewai/tools/tool_usage.py @@ -204,6 +204,8 @@ class ToolUsage: raise ValueError("Required arguments missing for tool") arguments = calling.arguments result = tool.invoke(input=arguments) + except ValueError as ve: + raise ve except Exception as e: self.on_tool_error(tool=tool, tool_calling=calling, e=e) self._run_attempts += 1