feat: add custom exceptions module

This commit is contained in:
Paul Gauthier 2024-11-07 12:19:41 -08:00 committed by Paul Gauthier (aider)
parent 728f4a0f81
commit 62e93d4002

35
aider/exceptions.py Normal file
View file

@ -0,0 +1,35 @@
def retry_exceptions():
import httpx
import openai
return (
# httpx
httpx.ConnectError,
httpx.RemoteProtocolError,
httpx.ReadTimeout,
#
# litellm exceptions inherit from openai exceptions
# https://docs.litellm.ai/docs/exception_mapping
#
# openai.BadRequestError,
# litellm.ContextWindowExceededError,
# litellm.ContentPolicyViolationError,
#
# openai.AuthenticationError,
# openai.PermissionDeniedError,
# openai.NotFoundError,
#
openai.APITimeoutError,
openai.UnprocessableEntityError,
openai.RateLimitError,
openai.APIConnectionError,
# openai.APIError,
# openai.APIStatusError,
openai.InternalServerError,
)
class LiteLLMExceptions:
# ai