diff --git a/src/coverup/llm.py b/src/coverup/llm.py index 6117f51..c9302d8 100644 --- a/src/coverup/llm.py +++ b/src/coverup/llm.py @@ -5,6 +5,7 @@ import warnings import textwrap import json +import traceback with warnings.catch_warnings(): # ignore pydantic warnings https://github.com/BerriAI/litellm/issues/2832 @@ -291,6 +292,12 @@ def _call_function(self, ctx: object, tool_call: dict) -> str: try: return str(function['function'](ctx=ctx, **args)) except Exception as e: + self._log_msg(ctx, f"""\ +Error executing function "{tool_call.function.name}": {e} +args:{args} + +{traceback.format_exc()} +""") return f'Error executing function: {e}'