fix(aws_secret_manager_V2.py): Error reading secret from AWS Secrets Manager: (#7541)

This commit is contained in:
Krish Dholakia 2025-01-03 18:22:12 -08:00 committed by GitHub
parent 8ad9526625
commit cac06a32b8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -127,10 +127,14 @@ class AWSSecretsManagerV2(BaseAWSLLM):
response = sync_client.post(
url=endpoint_url, headers=headers, data=body.decode("utf-8")
)
response.raise_for_status()
return response.json()["SecretString"]
except httpx.TimeoutException:
raise ValueError("Timeout error occurred")
except httpx.HTTPStatusError as e:
verbose_logger.exception(
"Error reading secret from AWS Secrets Manager: %s",
str(e.response.text),
)
except Exception as e:
verbose_logger.exception(
"Error reading secret from AWS Secrets Manager: %s", str(e)