Home:ALL Converter>Fail an AWS Lambda in Java Without Exception

Fail an AWS Lambda in Java Without Exception

Ask Time:2018-07-19T03:51:55         Author:doeiqts

Json Formatter

If an unhandled exception escapes an AWS Java Lambda it will be treated as an error for that lambda. The node.js version of AWS Lambda seem to have a way to call context.fail() to signal that the AWS Lambda was not successful but without have an exception escape.

Is there something similar for the Java version of AWS Lambda?

It seems that unhandled exceptions that escape an AWS Lambda in Java not only mark the invocation as an error but also destroys that Lambda so that a new cold lambda is needed to replace it. I'd like to have the Lambda fail without being destroyed by the unhandled exception.

Is this possible?

Author:doeiqts,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/51410016/fail-an-aws-lambda-in-java-without-exception
yy