fix(utils.py): predibase exception mapping - map 424 as a badrequest error

This commit is contained in:
Krrish Dholakia 2024-06-25 13:47:38 -07:00
parent 6e02ac0056
commit 6889a4c0dd
3 changed files with 28 additions and 28 deletions

View file

@ -6157,13 +6157,6 @@ def exception_type(
response=original_exception.response,
litellm_debug_info=extra_information,
)
if "Request failed during generation" in error_str:
# this is an internal server error from predibase
raise litellm.InternalServerError(
message=f"PredibaseException - {error_str}",
llm_provider="predibase",
model=model,
)
elif hasattr(original_exception, "status_code"):
if original_exception.status_code == 500:
exception_mapping_worked = True
@ -6201,7 +6194,10 @@ def exception_type(
llm_provider=custom_llm_provider,
litellm_debug_info=extra_information,
)
elif original_exception.status_code == 422:
elif (
original_exception.status_code == 422
or original_exception.status_code == 424
):
exception_mapping_worked = True
raise BadRequestError(
message=f"PredibaseException - {original_exception.message}",