mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-30 09:14:59 +00:00
fix: Improve error handling in EditBlockCoder
This commit is contained in:
parent
f5a546834d
commit
f723fbefc3
1 changed files with 6 additions and 6 deletions
|
@ -35,15 +35,15 @@ class EditBlockCoder(Coder):
|
||||||
shell=True,
|
shell=True,
|
||||||
encoding=self.io.encoding,
|
encoding=self.io.encoding,
|
||||||
errors="replace",
|
errors="replace",
|
||||||
capture_output=True,
|
|
||||||
)
|
)
|
||||||
if result.returncode != 0:
|
if result.returncode == 0:
|
||||||
self.io.tool_error(f"Command '{command}' exited with status {result.returncode}")
|
return
|
||||||
self.io.tool_error(result.stderr)
|
self.io.tool_error(f"Command '{command}' exited with status {result.returncode}")
|
||||||
return result
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.io.tool_error(f"Error running command '{command}': {str(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):
|
def handle_shell_commands(self, commands_str):
|
||||||
commands = commands_str.strip().splitlines()
|
commands = commands_str.strip().splitlines()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue