Skip to content
New issue

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

Http status code 500 on Invalid JSON request #673

Open
reestolonio opened this issue Oct 22, 2020 · 0 comments
Open

Http status code 500 on Invalid JSON request #673

reestolonio opened this issue Oct 22, 2020 · 0 comments

Comments

@reestolonio
Copy link

Describe the bug
When testing an invalid JSON request, API returns HTTP status code 500.

To Reproduce

ERROR Error: The request body is not JSON even though the Content-Type is set to application/json
at parseJsonBody (/var/task/api/webpack:/node_modules/@laconia/event/src/apigateway/parseRequestBody.js:8:11)
at parseRequestBody (/var/task/api/webpack:/node_modules/@laconia/event/src/apigateway/parseRequestBody.js:19:12)
at req (/var/task/api/webpack:/node_modules/@laconia/event/src/apigateway/ApiGatewayEvent.js:11:11)
at e.exports.convert (/var/task/api/webpack:/node_modules/@laconia/adapter-api/src/ApiGatewayBodyInputConverter.js:5:29)
at e.exports.app [as handle] (/var/task/api/webpack:/node_modules/@laconia/adapter-api/src/ApiGatewayEventAdapter.js:17:45)
at Object.r (/var/task/api/webpack:/node_modules/@laconia/core/src/laconia.js:30:14)

Expected behavior
API should return HTTP status code 400 (bad request)

Actual behavior
API returns HTTP status code 500

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants