From 3b2f1f1e664d331d0ccfa79fa56584ed4f7fcdb3 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Fri, 1 Nov 2024 09:09:03 -0700 Subject: [PATCH] style: format long error messages with line breaks --- aider/coders/base_coder.py | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/aider/coders/base_coder.py b/aider/coders/base_coder.py index af4faff05..76968afe2 100755 --- a/aider/coders/base_coder.py +++ b/aider/coders/base_coder.py @@ -796,15 +796,26 @@ class Coder: friendly_msg = None if isinstance(exc, (openai.APITimeoutError, openai.APIConnectionError)): - friendly_msg = "The API provider is having connectivity issues. Please try again in a moment." + friendly_msg = ( + "The API provider is having connectivity issues. Please try again in a moment." + ) elif isinstance(exc, openai.RateLimitError): - friendly_msg = "The API provider's rate limits have been exceeded. Please wait a moment before trying again." + friendly_msg = ( + "The API provider's rate limits have been exceeded. Please wait a moment before" + " trying again." + ) elif isinstance(exc, openai.InternalServerError): - friendly_msg = "The API provider is experiencing internal issues. Please try again later." + friendly_msg = ( + "The API provider is experiencing internal issues. Please try again later." + ) elif isinstance(exc, openai.BadRequestError): - friendly_msg = "The request was invalid. This might be due to the API provider changing their API." + friendly_msg = ( + "The request was invalid. This might be due to the API provider changing their API." + ) elif isinstance(exc, openai.AuthenticationError): - friendly_msg = "There was an issue with your API authentication. Please check your API key." + friendly_msg = ( + "There was an issue with your API authentication. Please check your API key." + ) if friendly_msg: self.io.tool_error(f"{friendly_msg}\nTechnical details: {text}")