Skip to content

Commit

Permalink
fix: handle non-json SQS response bodies
Browse files Browse the repository at this point in the history
fixes #679
  • Loading branch information
brettstack committed Apr 29, 2024
1 parent cc9a597 commit 157fbc2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/event-sources/aws/sqs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 157fbc2

Please sign in to comment.