fix: Handle exceptions in the send method of base_coder.py

This commit is contained in:
Paul Gauthier (aider) 2024-08-13 17:31:27 -07:00
parent 8115cbbd3a
commit 6980cfd115

View file

@ -1244,6 +1244,7 @@ class Coder:
self.io.log_llm_history("TO LLM", format_messages(messages))
completion = None
try:
hash_object, completion = send_completion(
model.name,
@ -1263,6 +1264,8 @@ class Coder:
except KeyboardInterrupt as kbi:
self.keyboard_interrupt()
raise kbi
except Exception as e:
self.io.tool_error(f"Error during API call: {str(e)}")
finally:
self.io.log_llm_history(
"LLM RESPONSE",