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 continue
self.io.tool_output(f"\nExecuting: {cmd}") self.io.tool_output(f"\nExecuting: {cmd}")
# catch switchcoder exception and print error that cmd is only supported with interactive /commands ai! try:
self.run(cmd) 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): def completions_raw_save(self, document, complete_event):
return self.completions_raw_read_only(document, complete_event) return self.completions_raw_read_only(document, complete_event)