fix: Handle SwitchCoder exception in cmd_load

This commit is contained in:
Paul Gauthier (aider) 2024-12-26 09:57:09 -05:00
parent befe6be86c
commit 91c9b1bfe7

View file

@ -1309,8 +1309,12 @@ class Commands:
continue
self.io.tool_output(f"\nExecuting: {cmd}")
# catch switchcoder exception and print error that cmd is only supported with interactive /commands ai!
self.run(cmd)
try:
self.run(cmd)
except SwitchCoder:
self.io.tool_error(
f"Command '{cmd}' is only supported in interactive mode, skipping."
)
def completions_raw_save(self, document, complete_event):
return self.completions_raw_read_only(document, complete_event)