We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The message looks like:
{ "Records": [ { "EventSource": "aws:sns", "EventVersion": "1.0", "EventSubscriptionArn": "arn:aws:sns:XXXXXXXXXXXXXXX-monitoring:9b9asdff5-be7f-safa-958a-000000000000", "Sns": { "Type": "Notification", "MessageId": "318b60f7-fae6sdfd-5fasd93-ae63-XXXXXXXXXX", "TopicArn": "arn:aws:sns:XXXXXXXXXXXXXX-monitoring", "Subject": "Test - AWS Cloudwatch - Lamda", "Message": "Test - AWS Cloudwatch - Lamda", "Timestamp": "2019-03-07T07:00:50.306Z", "SignatureVersion": "1", "Signature": "Kmdfh5Lr5LpBeTXgZJRdPHohmHRdQn6NmXXXXXXXXXXXXXXXXXXXXXXXXXxthnjHorUS+BNbW9892imFRcH==", "SigningCertUrl": "https://sns.XXXXXXXXXXX.pem", "UnsubscribeUrl": "https://sns.XXXXXXXXXXX958a-a3sd12jf4l3ka4s8d", "MessageAttributes": {} } } ] }
Records[0].Sns.Message is no object in this case and JSON.parse fails here:
index.js:319 var message = JSON.parse(record.Sns.Message)
Check if Records[0].Sns.Message is a object:
index.js:319 var message = typeof record.Sns.Message === 'object' index.js:320 ? JSON.parse(record.Sns.Message) index.js:321 : { message: record.Sns.Message}
The text was updated successfully, but these errors were encountered:
No branches or pull requests
How to produces:
Goto AWS SNS -> Topic -> public a message
The message looks like:
Records[0].Sns.Message is no object in this case and JSON.parse fails here:
How to fix (one way):
Check if Records[0].Sns.Message is a object:
The text was updated successfully, but these errors were encountered: