Terminate AWS Lambda execution out of the handler function

Viewed 334

Is there a way to terminate the AWS Lambda function execution (.NET Core) in a method different than the one declared as a handler?

I tried to run "Environment.Exit(0)" when some condition is fulfilled but the execution results in the error as below:

{
  "errorMessage": "RequestId: fake-request-id Error: Runtime exited without providing a reason",
  "errorType": "Runtime.ExitError"
}
0 Answers
Related