From 9bd1f4ebd05126ce4a48da1abe992233e0273a03 Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Thu, 16 Nov 2023 22:02:19 -0800 Subject: [PATCH] fix(utils.py): improve exception mapping for vertex ai --- litellm/utils.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/litellm/utils.py b/litellm/utils.py index 4a3f4db9b7a..07d376d3046 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -3612,6 +3612,14 @@ def exception_type( llm_provider="vertex_ai", response=original_exception.response ) + elif "403 Permission denied" in error_str: + exception_mapping_worked = True + raise AuthenticationError( + message=f"VertexAIException - {error_str}", + model=model, + llm_provider="vertex_ai", + response=original_exception.response + ) elif custom_llm_provider == "palm": if "503 Getting metadata" in error_str: # auth errors look like this