Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: Define an exception for temporary 502 errors #6550

Open
enyst opened this issue Nov 1, 2024 · 0 comments
Open

[Feature]: Define an exception for temporary 502 errors #6550

enyst opened this issue Nov 1, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@enyst
Copy link
Contributor

enyst commented Nov 1, 2024

The Feature

Please define the error with http code 502 (bad gateway) separately from API Error.

Motivation, pitch

Over at openhands, we are using litellm SDK and have retries with tenacity on completion. We have encountered an issue:

  • litellm's APIError is a catch-all for various permanent errors (e.g. entity too large, Cloudflare blocks, etc), so we should not retry on it
  • but it includes 502, bad gateway, which is typically temporary, so we should retry on it.

Could you please separate and define another exception for 502?

It seems a good idea to me simply because one is temporary and others permanent. Normally no one wants to retry things that cannot succeed.

Note: litellm proxy itself can return quite a number of 502 errors, and they are clearly temporary. It's one of the most common temporary errors out there. 😅 Please help us catch them nicely, without the rest of API Error.

Twitter / LinkedIn details

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant