mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 16:54:59 +00:00
refactor: improve chat history file error handling and messaging
This commit is contained in:
parent
ea3359fb4b
commit
854d908fe0
1 changed files with 3 additions and 5 deletions
|
@ -694,11 +694,9 @@ class InputOutput:
|
||||||
try:
|
try:
|
||||||
with self.chat_history_file.open("a", encoding=self.encoding, errors="ignore") as f:
|
with self.chat_history_file.open("a", encoding=self.encoding, errors="ignore") as f:
|
||||||
f.write(text)
|
f.write(text)
|
||||||
except (PermissionError, OSError):
|
except (PermissionError, OSError) as err:
|
||||||
self.tool_error(
|
print(f"Warning: Unable to write to chat history file {self.chat_history_file}.")
|
||||||
f"Warning: Unable to write to chat history file {self.chat_history_file}."
|
print(err)
|
||||||
" Permission denied."
|
|
||||||
)
|
|
||||||
self.chat_history_file = None # Disable further attempts to write
|
self.chat_history_file = None # Disable further attempts to write
|
||||||
|
|
||||||
def format_files_for_input(self, rel_fnames, rel_read_only_fnames):
|
def format_files_for_input(self, rel_fnames, rel_read_only_fnames):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue