From 81ad2ab65521d1495cc5bdf06356ee5d7a15c088 Mon Sep 17 00:00:00 2001 From: Lorenze Jay Date: Mon, 24 Feb 2025 11:52:50 -0800 Subject: [PATCH] feat: Add LLMCallFailedEvent emission for tool execution errors Enhance error handling by emitting a specific event when tool execution fails during LLM calls --- src/crewai/llm.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/crewai/llm.py b/src/crewai/llm.py index 1165ab354..a0378cd2d 100644 --- a/src/crewai/llm.py +++ b/src/crewai/llm.py @@ -382,6 +382,12 @@ class LLM: error=str(e), ), ) + crewai_event_bus.emit( + self, + event=LLMCallFailedEvent( + error=f"Tool execution error: {str(e)}" + ), + ) return text_response else: