From f723fbefc3c5ee7d7cfc0798c4179957b9615a33 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Wed, 21 Aug 2024 15:36:36 -0700 Subject: [PATCH] fix: Improve error handling in EditBlockCoder --- aider/coders/editblock_coder.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/aider/coders/editblock_coder.py b/aider/coders/editblock_coder.py index 5a5fc879c..35029a1d7 100644 --- a/aider/coders/editblock_coder.py +++ b/aider/coders/editblock_coder.py @@ -35,15 +35,15 @@ class EditBlockCoder(Coder): shell=True, encoding=self.io.encoding, errors="replace", - capture_output=True, ) - if result.returncode != 0: - self.io.tool_error(f"Command '{command}' exited with status {result.returncode}") - self.io.tool_error(result.stderr) - return result + if result.returncode == 0: + return + self.io.tool_error(f"Command '{command}' exited with status {result.returncode}") except Exception as e: self.io.tool_error(f"Error running command '{command}': {str(e)}") - return None + + self.io.tool_output(f"To retry and share output with the LLM: /run {command}") + self.io.tool_output(f"You can find this command in your input history with up-arrow.") def handle_shell_commands(self, commands_str): commands = commands_str.strip().splitlines()