I'm trying to invoke a lambda function. The function works when the data is available resolve(), but when there is an error, it does not proceed with the callback, and just gives me an error.
lambda.invoke({
FunctionName: 'cognitoFunction',
Payload: JSON.stringify({
email: slots.Email
})
}, function(err, data) {
if(err) { // Does not work
callback(close3(sessionAttributes, { "contentType": "PlainText", "content": "ERROR" }));
}
else { // This part works
callback()
}
});
"errorType": "DependencyFailedException",
"errorMessage": "Invalid Lambda Response: Received error response from Lambda: Unhandled"