in dotnet/datastax-v3/connection-lambda/src/keyspaces-lambda-csharp/LambdaSample.cs [20:38]
public string FunctionHandler(SQSEvent invocationEvent, ILambdaContext context)
{
try
{
LambdaLogger.Log("ENVIRONMENT VARIABLES: " + JsonConvert.SerializeObject(Environment.GetEnvironmentVariables()));
LambdaLogger.Log("CONTEXT: " + JsonConvert.SerializeObject(context));
LambdaLogger.Log("EVENT: " + JsonConvert.SerializeObject(invocationEvent));
int result = KeyspacesSession.Instance().validateConnection();
if (result == 200)
return "200 OK";
}
catch (Exception e)
{
LambdaLogger.Log("Caught an exception: " + e.ToString());
}
LambdaLogger.Log("Something went wrong. Please see the exception message and stack trace for more details.");
return "400 Bad Request";
}