mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-03 03:05:00 +00:00
feat: add traceback printing for file read errors
This commit is contained in:
parent
5e1be966ed
commit
ebdc126b00
1 changed files with 2 additions and 1 deletions
|
@ -319,8 +319,9 @@ class InputOutput:
|
||||||
with open(str(filename), "r", encoding=self.encoding) as f:
|
with open(str(filename), "r", encoding=self.encoding) as f:
|
||||||
return f.read()
|
return f.read()
|
||||||
except OSError as err:
|
except OSError as err:
|
||||||
|
import traceback
|
||||||
self.tool_error(f"{filename}: unable to read: {err}")
|
self.tool_error(f"{filename}: unable to read: {err}")
|
||||||
#ai print the trackback stack!
|
self.tool_error("Traceback:\n" + "".join(traceback.format_stack()))
|
||||||
return
|
return
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
self.tool_error(f"{filename}: file not found error")
|
self.tool_error(f"{filename}: file not found error")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue