Closed rafaroca closed 2 years ago
@FRosner I am trying to return a LambdaResponse which fits to the documentation. I cannot get far though, as my exception is not caught. The JVM seems to exit before the catch clause is executed at LambdaHandler:62. Do you have any clue why there is no log output from the logger inside the catch? I can't fathom why there's nothing in CloudWatch. Every RuntimeException should hit the catch clause, right?
After reading the CloudWatch output once again, it became clear: Task timed out after 3.00 seconds
. Well, there's my problem. Increasing the timeout to 30s, it reveals a proper error message.
There is a generic 400 error message now. I'd leave it for this. If you would rather have a fully fledged verification of the Order, then we can open another ticket :)
Thanks @rafaroca!
The LambdaHandler throws an exception when the POSTed order is not valid. Since the exception is never caught, the exception message never surfaces anywhere in the logs. The API Gateway returns 500 Server Error.
This should instead give the user a proper 400 code and a message what is wrong with the request.