From 157fbc2d689a82d72984421921fe8992ba01bf8d Mon Sep 17 00:00:00 2001 From: Brett Date: Tue, 30 Apr 2024 07:52:42 +0930 Subject: [PATCH] fix: handle non-json SQS response bodies fixes #679 --- src/event-sources/aws/sqs.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/event-sources/aws/sqs.js b/src/event-sources/aws/sqs.js index 457285c4..83aabef4 100644 --- a/src/event-sources/aws/sqs.js +++ b/src/event-sources/aws/sqs.js @@ -10,7 +10,11 @@ const getRequestValuesFromSqs = ({ event }) => { } } -const getResponseToSqs = ({ body }) => JSON.parse(body) +const getResponseToSqs = ({ body }) => { + try { + return JSON.parse(body) + } catch (error) {} +} module.exports = { getRequest: getRequestValuesFromSqs,