-
Notifications
You must be signed in to change notification settings - Fork 30
Description
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