From 952bf761ceeb5d8c611a2c51da6af7981150fc51 Mon Sep 17 00:00:00 2001 From: Hakan Erol <47988814+hakan458@users.noreply.github.com> Date: Tue, 1 Oct 2024 15:05:57 -0700 Subject: [PATCH] fix: DIA-1441: RecursionError better traceback logging (#220) --- adala/runtimes/_litellm.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/adala/runtimes/_litellm.py b/adala/runtimes/_litellm.py index c54df97c..06976d27 100644 --- a/adala/runtimes/_litellm.py +++ b/adala/runtimes/_litellm.py @@ -84,7 +84,9 @@ def _format_error_dict(e: Exception) -> dict: def _log_llm_exception(e) -> dict: dct = _format_error_dict(e) base_error = f"Inference error {dct['_adala_message']}" - tb = traceback.format_exc() + tb = "".join( + traceback.format_exception(e) + ) # format_exception return list of strings ending in new lines logger.error(f"{base_error}\nTraceback:\n{tb}") return dct