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 85884df commit ac8f738
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def lambda_handler(event, context):
logging.getLogger("urllib3").setLevel(logging.WARNING)
#
# If this is an event from a failed call. Report that and return.
if event['detail']['errorCode'] != None:
if event['detail'].get('errorCode') != None:
logger.warning(f"This is reporting on a error event. Error Code: {event['detail']['errorCode']}. Error Message: {event['detail']['errorMessage']}.")
return
#
Expand Down

0 comments on commit ac8f738

Please sign in to comment.