From 1e7d9c18ecbcf244219d14ddb80e9a690079f52e Mon Sep 17 00:00:00 2001 From: "piotr.drazikowski" Date: Mon, 11 Jan 2021 15:18:30 +0100 Subject: [PATCH] handling sns messages that are parsed by json.loads() but are other than a dict --- zappa/handler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zappa/handler.py b/zappa/handler.py index 78a31cfda..b10c9e417 100644 --- a/zappa/handler.py +++ b/zappa/handler.py @@ -301,7 +301,7 @@ def get_function_for_aws_event(self, record): message = json.loads(record['Sns']['Message']) if message.get('command'): return message['command'] - except ValueError: + except (AttributeError, ValueError): pass arn = record['Sns'].get('TopicArn') elif 'dynamodb' in record or 'kinesis' in record: