mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 18:25:00 +00:00
feat: add error handling for file writing in InputOutput class
This commit is contained in:
parent
b3928dabbc
commit
b3ce70234e
1 changed files with 5 additions and 2 deletions
|
@ -259,8 +259,11 @@ class InputOutput:
|
|||
def write_text(self, filename, content):
|
||||
if self.dry_run:
|
||||
return
|
||||
with open(str(filename), "w", encoding=self.encoding) as f:
|
||||
f.write(content)
|
||||
try:
|
||||
with open(str(filename), "w", encoding=self.encoding) as f:
|
||||
f.write(content)
|
||||
except OSError as err:
|
||||
self.tool_error(f"Unable to write file {filename}: {err}")
|
||||
|
||||
def rule(self):
|
||||
if self.pretty:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue