mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-02 02:34:59 +00:00
catch git errors from all /commands
This commit is contained in:
parent
fcf83cb9ee
commit
d7d3f3a740
1 changed files with 7 additions and 3 deletions
|
@ -188,10 +188,14 @@ class Commands:
|
||||||
cmd_name = cmd_name.replace("-", "_")
|
cmd_name = cmd_name.replace("-", "_")
|
||||||
cmd_method_name = f"cmd_{cmd_name}"
|
cmd_method_name = f"cmd_{cmd_name}"
|
||||||
cmd_method = getattr(self, cmd_method_name, None)
|
cmd_method = getattr(self, cmd_method_name, None)
|
||||||
if cmd_method:
|
if not cmd_method:
|
||||||
return cmd_method(args)
|
|
||||||
else:
|
|
||||||
self.io.tool_output(f"Error: Command {cmd_name} not found.")
|
self.io.tool_output(f"Error: Command {cmd_name} not found.")
|
||||||
|
return
|
||||||
|
|
||||||
|
try:
|
||||||
|
return cmd_method(args)
|
||||||
|
except ANY_GIT_ERROR as err:
|
||||||
|
self.io.tool_error(f"Unable to complete {cmd_name}: {err}")
|
||||||
|
|
||||||
def matching_commands(self, inp):
|
def matching_commands(self, inp):
|
||||||
words = inp.strip().split()
|
words = inp.strip().split()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue