mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 02:05:00 +00:00
fix: Handle empty status codes in litellm retry decorator
This commit is contained in:
parent
9c29eaf776
commit
4a42a07237
1 changed files with 8 additions and 0 deletions
|
@ -29,6 +29,14 @@ def lazy_litellm_retry_decorator(func):
|
||||||
):
|
):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
# These seem to return .status_code = ""
|
||||||
|
# litellm._should_retry() expects an int and throws a TypeError
|
||||||
|
#
|
||||||
|
# litellm.llms.anthropic.AnthropicError
|
||||||
|
# litellm.exceptions.APIError
|
||||||
|
if not e.status_code:
|
||||||
|
return False
|
||||||
|
|
||||||
return not litellm._should_retry(e.status_code)
|
return not litellm._should_retry(e.status_code)
|
||||||
|
|
||||||
decorated_func = backoff.on_exception(
|
decorated_func = backoff.on_exception(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue