From 6980cfd1156b8b39274d35b0994539cc59c05c75 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Tue, 13 Aug 2024 17:31:27 -0700 Subject: [PATCH] fix: Handle exceptions in the send method of base_coder.py --- aider/coders/base_coder.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aider/coders/base_coder.py b/aider/coders/base_coder.py index da386a197..3fdc12260 100755 --- a/aider/coders/base_coder.py +++ b/aider/coders/base_coder.py @@ -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",