From b2cc08abbf09399e0cc51c1f65236d7a4fef7e1c Mon Sep 17 00:00:00 2001 From: Bohdan Danyliuk Date: Thu, 25 Sep 2025 18:00:57 +0200 Subject: [PATCH] try to catch errors in a different way --- src/agents/tool.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/agents/tool.py b/src/agents/tool.py index 7ba9435ed..22fc603d0 100644 --- a/src/agents/tool.py +++ b/src/agents/tool.py @@ -456,6 +456,13 @@ async def _on_invoke_tool(ctx: ToolContext[Any], input: str) -> Any: }, ) ) + if _debug.DONT_LOG_TOOL_DATA: + logger.debug(f"Tool {schema.name} failed") + else: + logger.error( + f"Tool {schema.name} failed: {input} {e}", + exc_info=e, + ) return result return FunctionTool(