From ebdc126b008eaac79034648ce15001560f7b7f12 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Mon, 4 Nov 2024 09:05:24 -0800 Subject: [PATCH] feat: add traceback printing for file read errors --- aider/io.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aider/io.py b/aider/io.py index 29ec13b58..b6b7d5820 100644 --- a/aider/io.py +++ b/aider/io.py @@ -319,8 +319,9 @@ class InputOutput: with open(str(filename), "r", encoding=self.encoding) as f: return f.read() except OSError as err: + import traceback self.tool_error(f"{filename}: unable to read: {err}") - #ai print the trackback stack! + self.tool_error("Traceback:\n" + "".join(traceback.format_stack())) return except FileNotFoundError: self.tool_error(f"{filename}: file not found error")