mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-10 22:41:41 +00:00
#38318 taught exception_type to map upstream status codes for providers with no branch of their own. It reads the status code off the exception, but _handle_error stamps 500 onto every failure that never carried one, so a refused connection reached the mapper wearing a status code nothing upstream had sent, and came back as InternalServerError instead of APIConnectionError. The two are not interchangeable to a caller: a 5xx says the provider answered and failed, which the router treats as a reason to cool the deployment down, while a connection error says the request never landed. BaseLLMException now records whether its status code was received or synthesized, _handle_error sets that when it invents the 500, and the status mapper declines to act on a code litellm made up, so those failures fall through to the APIConnectionError the branch was always meant to produce. Genuine upstream 5xx responses are untouched, which the second test pins. The search transformation assertion #38318 had loosened to InternalServerError goes back to APIConnectionError for the same reason. |
||
|---|---|---|
| .. | ||
| test_base_search_transformation.py | ||