litellm/tests/unit/llms/mongodb
izzybn 050aec309f
fix(exceptions): keep the provider error body on e.response for SDK callers (#53587)
* fix(sdk): keep the provider error body on e.response for Responses and shared handler errors

SDK callers who caught a litellm exception got an empty e.response, so e.response.text was '' and e.response.json() raised JSONDecodeError

The exception now carries the provider's status, body, and charset. Its headers and request stay as they were, so proxy replies and retry behavior do not change, and the outbound credentials are never attached

* fix(exceptions): keep the reported status when attaching the provider reply

* fix(exceptions): keep mapped errors for text status codes and attach provider replies on post-response status checks

* fix(vector_stores): keep the provider reply body when a provider config raises a litellm exception

* fix(files): keep the provider reply body on file content download errors

* fix(search): keep the provider reply body on search errors, and give it the exception's status when it had no response

* fix(exceptions): give a remapped error's provider reply the remapped status

---------

Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
2026-11-23 07:23:53 +00:00
..
vector_stores fix(exceptions): keep the provider error body on e.response for SDK callers (#53587) 2026-11-23 07:23:53 +00:00
__init__.py test(unit): make every tests/unit directory a package so pytest collection is unique 2026-09-20 11:50:59 +00:00