From 854d908fe0f60137d579e47a954d1b4e7cf6822b Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Wed, 30 Oct 2024 06:37:59 -0700 Subject: [PATCH] refactor: improve chat history file error handling and messaging --- aider/io.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/aider/io.py b/aider/io.py index f71340d92..ae2967719 100644 --- a/aider/io.py +++ b/aider/io.py @@ -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):