Skip to content

Commit

Permalink
Allowed it to handle it gracefully when the event is from a failed vo…
Browse files Browse the repository at this point in the history
…lume creation.
  • Loading branch information
kcantrel committed Sep 5, 2024
1 parent 1a83d79 commit 85884df
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ def lambda_handler(event, context):
logging.getLogger("boto3").setLevel(logging.WARNING)
logging.getLogger("urllib3").setLevel(logging.WARNING)
#
# If this is an event from a failed call. Report that and return.
if event['detail']['errorCode'] != None:
logger.warning(f"This is reporting on a error event. Error Code: {event['detail']['errorCode']}. Error Message: {event['detail']['errorMessage']}.")
return
#
# Create a Secrets Manager client.
session = boto3.session.Session()
secretsManagerClient = session.client(service_name='secretsmanager', region_name=secretsManagerRegion)
Expand Down

0 comments on commit 85884df

Please sign in to comment.