mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
fix testing exception mapping
This commit is contained in:
parent
d0dbc0742b
commit
bcc89a2c3a
3 changed files with 27 additions and 1 deletions
|
@ -479,7 +479,7 @@ def mock_completion(
|
|||
if isinstance(mock_response, Exception):
|
||||
if isinstance(mock_response, openai.APIError):
|
||||
raise mock_response
|
||||
raise litellm.APIError(
|
||||
raise litellm.MockException(
|
||||
status_code=getattr(mock_response, "status_code", 500), # type: ignore
|
||||
message=getattr(mock_response, "text", str(mock_response)),
|
||||
llm_provider=getattr(mock_response, "llm_provider", custom_llm_provider or "openai"), # type: ignore
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue