working test

This commit is contained in:
Paul Gauthier 2023-07-06 10:55:38 -07:00
parent 391088fd14
commit 3c443d68d0
3 changed files with 38 additions and 2 deletions

View file

@ -290,9 +290,10 @@ class Coder:
def get_abs_fnames_content(self):
for fname in list(self.abs_fnames):
content = self.io.read_text(fname)
dump(fname, content)
if content is None:
relative_fname = self.get_rel_fname(fname)
self.tool_error(f"Dropping {relative_fname} from the chat.")
self.io.tool_error(f"Dropping {relative_fname} from the chat.")
self.abs_fnames.remove(fname)
else:
yield fname, content

View file

@ -141,7 +141,10 @@ class InputOutput:
try:
with open(str(filename), "r", encoding=self.encoding) as f:
return f.read()
except (FileNotFoundError, UnicodeError) as e:
except FileNotFoundError:
self.tool_error(f"{filename}: file not found error")
return
except UnicodeError as e:
self.tool_error(f"{filename}: {e}")
return