From 4a26bc6c70810123fa5751cd046ab7ce84eb9352 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Thu, 29 Aug 2024 09:18:17 -0700 Subject: [PATCH] fix: improve exception handling to show correct filename and line number --- aider/report.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/aider/report.py b/aider/report.py index caabf8f7a..7530964b6 100644 --- a/aider/report.py +++ b/aider/report.py @@ -55,8 +55,14 @@ def exception_handler(exc_type, exc_value, exc_traceback): tb_lines = traceback.format_exception(exc_type, exc_value, exc_traceback) tb_text = "".join(tb_lines) + # Find the first non-frozen frame + while exc_traceback: + filename = exc_traceback.tb_frame.f_code.co_filename + if not filename.startswith('