mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +00:00
fix(utils.py): fix watsonx exception mapping
This commit is contained in:
parent
3694b5e7c0
commit
29449aa5c1
2 changed files with 3 additions and 1 deletions
|
@ -3342,6 +3342,8 @@ def test_completion_watsonx():
|
||||||
print(response)
|
print(response)
|
||||||
except litellm.APIError as e:
|
except litellm.APIError as e:
|
||||||
pass
|
pass
|
||||||
|
except litellm.RateLimitError as e:
|
||||||
|
pass
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
pytest.fail(f"Error occurred: {e}")
|
pytest.fail(f"Error occurred: {e}")
|
||||||
|
|
||||||
|
|
|
@ -8514,7 +8514,7 @@ def exception_type(
|
||||||
request=original_exception.request,
|
request=original_exception.request,
|
||||||
)
|
)
|
||||||
elif custom_llm_provider == "watsonx":
|
elif custom_llm_provider == "watsonx":
|
||||||
if "token_quota_reached" in error_response:
|
if "token_quota_reached" in error_str:
|
||||||
exception_mapping_worked = True
|
exception_mapping_worked = True
|
||||||
raise RateLimitError(
|
raise RateLimitError(
|
||||||
message=f"WatsonxException: Rate Limit Errror - {error_str}",
|
message=f"WatsonxException: Rate Limit Errror - {error_str}",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue