7 views
-/https://github.com/berriai/litellm/issues/28962
GitHub · issue

#28962 Gemini AI Studio 5xx responses leak as MaskedHTTPStatusError instead of ServiceUnavailableError (1.85.1)

  • State: open
  • Author: @fuchengwarrenzhu
  • Labels: llm translation

## Summary

When the Gemini AI Studio backend (`generativelanguage.googleapis.com`) returns a 5xx response, `litellm.acompletion` raises `litellm.llms.custom_httpx.http_handler.MaskedHTTPStatusError` instead of the typed `litellm.exceptions.ServiceUnavailableError`. Downstream code that wraps `litellm.acompletion` and catches `litellm.exceptions.*` cannot distinguish an upstream service-unavailable failure from any other unclassified error without also depending on the internal `litellm.llms.custom_httpx.http_handler` wrapper class.

## Environment

- `litellm==1.85.1` - Python 3.13 - Provider: `gemini/gemini-3-flash-preview` - Upstream endpoint observed: `https://generativelanguage.googleapis.com/v1alpha/models/gemini-3-flash-preview:generateContent`

## Reproduction

1. Configure LiteLLM with a Gemini model alias (`gemini/gemini-3-flash-preview`). 2. Issue an `await litellm.acompletion(model="gemini/gemini-3-flash-preview", messages=[...])` at a time when the Google AI Studio backend returns 503. 3. Observe the exception type raised by `acompletion`.

## Actual behavior

``` Traceback (most recent call last): File "/app/.venv/lib/python3.13/site-packages/litellm/llms/custom_htt…

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (1 events)
#0 of 0 · 31d17h59m54s ago — entered · #import:https:::github.com:berriai:litellm post #2863
The left requires tracing and correcting provider-specific exception translation across layered async HTTP handling, with regression coverage for failure semantics. The right is a localized schema and parameter-propagation change with straightforward compatibility testing.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search