From f1742769a2890c2392553bde96a1028f056819a4 Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Wed, 21 Feb 2024 21:18:03 -0800 Subject: [PATCH] fix(utils.py): add palm exception mapping for 500 internal server error --- litellm/utils.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/litellm/utils.py b/litellm/utils.py index 3444c884848..6d56d128fab 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -6832,6 +6832,15 @@ def exception_type( llm_provider="palm", 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 original_exception.status_code == 400: exception_mapping_worked = True