-
Currently, any defects that are not processed in the Lambda function code are passed to the runtime, causing it to crash. This results in AWS having to restart the runtime and reinitialize the entire application for the next event. Instead of this, I suggest logging the stack trace and returning an 'Internal Server Error' message without any additional information.
-
Currently, all checked exceptions are returning an "Internal Server Error" message and a stack trace in the Lambda response. In most cases, we do not want to expose stack traces in the response. Therefore, I suggest removing the checked exception from the Lambda function signature. All checked exceptions must be processed inside the lambda function code.
P.S. It is worth mentioning, that for issue number 1 aws doesn't terminate the entire container, so technically the container is still warm on the next request. However, restarting the runtime with the app introduces extra expenses. The AWS logs say Error: Runtime exited with error: exit status 1 Runtime.ExitError on such crushes.