mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 11:14:04 +00:00
fix(utils.py): add palm exception mapping for 500 internal server error
This commit is contained in:
parent
2d62dee712
commit
f1742769a2
1 changed files with 9 additions and 0 deletions
|
@ -6832,6 +6832,15 @@ def exception_type(
|
||||||
llm_provider="palm",
|
llm_provider="palm",
|
||||||
response=original_exception.response,
|
response=original_exception.response,
|
||||||
)
|
)
|
||||||
|
if "500 An internal error has occurred." in error_str:
|
||||||
|
exception_mapping_worked = True
|
||||||
|
raise APIError(
|
||||||
|
status_code=original_exception.status_code,
|
||||||
|
message=f"PalmException - {original_exception.message}",
|
||||||
|
llm_provider="palm",
|
||||||
|
model=model,
|
||||||
|
request=original_exception.request,
|
||||||
|
)
|
||||||
if hasattr(original_exception, "status_code"):
|
if hasattr(original_exception, "status_code"):
|
||||||
if original_exception.status_code == 400:
|
if original_exception.status_code == 400:
|
||||||
exception_mapping_worked = True
|
exception_mapping_worked = True
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue