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:
|
||||
with self.chat_history_file.open("a", encoding=self.encoding, errors="ignore") as f:
|
||||
f.write(text)
|
||||
except (PermissionError, OSError):
|
||||
self.tool_error(
|
||||
f"Warning: Unable to write to chat history file {self.chat_history_file}."
|
||||
" Permission denied."
|
||||
)
|
||||
except (PermissionError, OSError) as err:
|
||||
print(f"Warning: Unable to write to chat history file {self.chat_history_file}.")
|
||||
print(err)
|
||||
self.chat_history_file = None # Disable further attempts to write
|
||||
|
||||
def format_files_for_input(self, rel_fnames, rel_read_only_fnames):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue