Skip to content

fix(client): translate APIConnectionError and ServiceUnavailableError distinctly - #104

Open
nhmorin wants to merge 1 commit into
Continuum-AI-Corp:mainfrom
nhmorin:fix/error-translation-connection
Open

nhmorin wants to merge 1 commit into
Continuum-AI-Corp:mainfrom
nhmorin:fix/error-translation-connection

Conversation

@nhmorin

@nhmorin nhmorin commented Sep 14, 2026

Copy link
Copy Markdown

Orca-Code-Review — push 1

Severity Count
P0 0
P1 0
P2 0
P3 0

✅ no blocking findings

Network-level failures (DNS, connection refused, TCP reset) currently land in the generic upstream_error bucket — same error_type as any other 503. That makes it impossible to tell "provider is unreachable" from "provider returned something unexpected" when debugging via request_log or the dashboard.

This adds two explicit handlers in _translate_error:

  • litellm.APIConnectionError maps to upstream_connection_error (503)
  • litellm.ServiceUnavailableError maps to upstream_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_error including the new ones.

… 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.

@orcacode-review orcacode-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐳 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant