Hi,
I am using Spring cloud function version 3.2.1 and Spring native 0.11.1 to build a native image using GRAALVM. I am deploying the native zip in AWS lambda function with 'Custom runtime on Amazon Linux 2' as Runtime.
My function has to throw an ResponseStatusException in case of bad requests and i defaulted it in the sample for the sake of simplicity.
@component
public class AddFunction implements Function<String, String> {
@OverRide
public String apply(String user){
if (true) {
throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "errorResponse");
}
return "Added user";
}
When I run this as a spring boot application / upload the jar with java11 runtime in lambda , I am getting 400 bad request response as expected. Whereas when I build a native linux image and run it through bootstrap in lambda, I can see that ResponseStatusException is printed in stack trace(logs) but the lambda is continuing to run and timing out. I want the native application to return the 400 bad request as a response to lambda like the regular jar.
Attaching the sample project to reproduce the issue, zip file I used as source in lambda and also screenshots of
demo.zip
the logs


demo-zip.zip