diff --git a/litellm/litellm_core_utils/exception_mapping_utils.py b/litellm/litellm_core_utils/exception_mapping_utils.py index 6729762c7cc..11b369de3b6 100644 --- a/litellm/litellm_core_utils/exception_mapping_utils.py +++ b/litellm/litellm_core_utils/exception_mapping_utils.py @@ -1349,25 +1349,22 @@ def _map_vertex_exception( ), ), ) - elif ( - not _structured_validation_signal( - error_str=error_str, + elif not _structured_validation_signal( + error_str=error_str, + response=getattr(original_exception, "response", None), + error_body=getattr(original_exception, "body", None), + ) and ( + "429 Quota exceeded" in error_str + or "Quota exceeded for" in error_str + or "Resource exhausted" in error_str + or "IndexError: list index out of range" in error_str + or "429 Unable to submit request because the service is temporarily out of capacity." in error_str + or ExceptionCheckers.is_error_str_rate_limit( + error_str, + status_code=getattr(original_exception, "status_code", None), response=getattr(original_exception, "response", None), error_body=getattr(original_exception, "body", None), ) - and ( - "429 Quota exceeded" in error_str - or "Quota exceeded for" in error_str - or "Resource exhausted" in error_str - or "IndexError: list index out of range" in error_str - or "429 Unable to submit request because the service is temporarily out of capacity." in error_str - or ExceptionCheckers.is_error_str_rate_limit( - error_str, - status_code=getattr(original_exception, "status_code", None), - response=getattr(original_exception, "response", None), - error_body=getattr(original_exception, "body", None), - ) - ) ): raise RateLimitError( message=f"litellm.RateLimitError: {custom_llm_provider}Exception - {error_str}",