From 797892b67974743f785d95a0636ec4a61a7eed4f Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Thu, 12 Oct 2023 15:38:09 -0700 Subject: [PATCH] (fix) add bedrock exception mapping for Auth --- litellm/utils.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/litellm/utils.py b/litellm/utils.py index 8a5eaba9b7..3694403a16 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -2495,6 +2495,13 @@ def exception_type( model=model, llm_provider="bedrock" ) + if "The security token included in the request is invalid": + exception_mapping_worked = True + raise AuthenticationError( + message=f"BedrockException Invalid Authentication - {error_str}", + model=model, + llm_provider="bedrock" + ) elif custom_llm_provider == "sagemaker": if "Unable to locate credentials" in error_str: exception_mapping_worked = True