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
We use res.sendStatus(200) in SQS handlers and that started to trigger the following error with minor upgrade of the package.
res.sendStatus(200)
{ "errorType": "Runtime.UnhandledPromiseRejection", "errorMessage": "SyntaxError: Unexpected token 'O', \"OK\" is not valid JSON", "reason": { "errorType": "SyntaxError", "errorMessage": "Unexpected token 'O', \"OK\" is not valid JSON", "stack": [ "SyntaxError: Unexpected token 'O', \"OK\" is not valid JSON", " at JSON.parse (<anonymous>)", " at Object.getResponseToSqs [as getResponse] (/opt/nodejs/node_modules/@codegenie/serverless-express/src/event-sources/aws/sqs.js:13:45)", " at forwardResponse (/opt/nodejs/node_modules/@codegenie/serverless-express/src/transport.js:33:39)", " at forwardRequestToNodeServer (/opt/nodejs/node_modules/@codegenie/serverless-express/src/transport.js:160:3)", " at process.processTicksAndRejections (node:internal/process/task_queues:95:5)" ] }, "promise": {}, "stack": [ "Runtime.UnhandledPromiseRejection: SyntaxError: Unexpected token 'O', \"OK\" is not valid JSON", " at process.<anonymous> (file:///var/runtime/index.mjs:1276:17)", " at process.emit (node:events:518:28)", " at emit (node:internal/process/promises:150:20)", " at processPromiseRejections (node:internal/process/promises:284:27)", " at process.processTicksAndRejections (node:internal/process/task_queues:96:32)" ] }
In case of res.sendStatus(204) the error message is SyntaxError: Unexpected end of JSON input.
res.sendStatus(204)
SyntaxError: Unexpected end of JSON input
I think it's related to #628.
The text was updated successfully, but these errors were encountered:
Thanks for the report. I'll update to swallow the JSON Parse error and return empty
Sorry, something went wrong.
157fbc2
chore(release): 4.14.1 [skip ci]
c3c1b9a
## [4.14.1](v4.14.0...v4.14.1) (2024-04-29) ### Bug Fixes * handle non-json SQS response bodies ([157fbc2](157fbc2)), closes [#679](#679)
🎉 This issue has been resolved in version 4.14.1 🎉
The release is available on:
Your semantic-release bot 📦🚀
No branches or pull requests
We use
res.sendStatus(200)
in SQS handlers and that started to trigger the following error with minor upgrade of the package.In case of
res.sendStatus(204)
the error message isSyntaxError: Unexpected end of JSON input
.I think it's related to #628.
The text was updated successfully, but these errors were encountered: