mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 16:54:59 +00:00
fix: Handle exceptions in the send method of base_coder.py
This commit is contained in:
parent
8115cbbd3a
commit
6980cfd115
1 changed files with 3 additions and 0 deletions
|
@ -1244,6 +1244,7 @@ class Coder:
|
||||||
|
|
||||||
self.io.log_llm_history("TO LLM", format_messages(messages))
|
self.io.log_llm_history("TO LLM", format_messages(messages))
|
||||||
|
|
||||||
|
completion = None
|
||||||
try:
|
try:
|
||||||
hash_object, completion = send_completion(
|
hash_object, completion = send_completion(
|
||||||
model.name,
|
model.name,
|
||||||
|
@ -1263,6 +1264,8 @@ class Coder:
|
||||||
except KeyboardInterrupt as kbi:
|
except KeyboardInterrupt as kbi:
|
||||||
self.keyboard_interrupt()
|
self.keyboard_interrupt()
|
||||||
raise kbi
|
raise kbi
|
||||||
|
except Exception as e:
|
||||||
|
self.io.tool_error(f"Error during API call: {str(e)}")
|
||||||
finally:
|
finally:
|
||||||
self.io.log_llm_history(
|
self.io.log_llm_history(
|
||||||
"LLM RESPONSE",
|
"LLM RESPONSE",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue