Conversation
… distinctly Network-level failures (DNS resolution, connection refused, TCP reset) currently fall through to the generic upstream_error catch-all in _translate_error, making them indistinguishable from other 503s in request_log and the dashboard. Add explicit handlers for litellm.APIConnectionError (network failures) and litellm.ServiceUnavailableError (explicit 503 from the provider) so operators can tell connection problems from generic upstream errors at a glance.
There was a problem hiding this comment.
🐳 OrcaCode Review
✅ No findings — nothing to flag in this PR. Great work!
OrcaCode Review — Route Smarter. Ship Safer. Spend Less.
Engine-reported: 315 calls · 13M tokens · 98% cached
❤️ Share · Install OrcaCode Review
Free on GitHub — the review runs on your own OrcaRouter key. If it helped, a shout-out goes a long way.
Share: X · Reddit · LinkedIn
Follow: X · Discord · LinkedIn · OrcaRouter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Orca-Code-Review — push 1
✅ no blocking findings
Network-level failures (DNS, connection refused, TCP reset) currently land in the generic
upstream_errorbucket — same error_type as any other 503. That makes it impossible to tell "provider is unreachable" from "provider returned something unexpected" when debugging viarequest_logor the dashboard.This adds two explicit handlers in
_translate_error:litellm.APIConnectionErrormaps toupstream_connection_error(503)litellm.ServiceUnavailableErrormaps toupstream_unavailable(503)The existing handlers (context window, not found, rate limit, auth, timeout) are unchanged. The generic catch-all still handles anything else.
8 tests cover every branch of
_translate_errorincluding the new ones.