Skip to content

Commit 157fbc2

Browse files
committed
fix: handle non-json SQS response bodies
fixes #679
1 parent cc9a597 commit 157fbc2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/event-sources/aws/sqs.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ const getRequestValuesFromSqs = ({ event }) => {
1010
}
1111
}
1212

13-
const getResponseToSqs = ({ body }) => JSON.parse(body)
13+
const getResponseToSqs = ({ body }) => {
14+
try {
15+
return JSON.parse(body)
16+
} catch (error) {}
17+
}
1418

1519
module.exports = {
1620
getRequest: getRequestValuesFromSqs,

0 commit comments

Comments
 (0)