AWS Lambda 给予 "Process exited before completing request"

AWS Lambda giving "Process exited before completing request"

我将以下代码上传到 lambda,但它一直给我错误:"errorMessage": "RequestId: bdfa695d-e8b8-11e6-952a-21bb5e95cff6 Process exited before completing request",即使我已经从完美运行的代码中修改了这段代码技能。 该代码只是告诉用户你好(用卡片),并且可以在用户说问我问题时问他们一个问题。这是我的代码: `

var APP_ID=undefined;

var Alexa = require('./AlexaSkill');

var Sample = function () {
    AlexaSkill.call(this, APP_ID);
};

var handlers = {
    'LaunchRequest': function () {

        this.emit(':ask', welcomeMessage, GetReprompt());
},
'Unhandled': function () {
    this.emit(':ask', welcomeMessage, GetReprompt());
},

'AMAZON.HelpIntent': function () {
    this.emit(':ask', HelpMessage, HelpMessage);
},

'AMAZON.StopIntent': function () {
    this.shouldEndSession = true;
    this.emit(':tell', stopSkillMessage, stopSkillMessage);
},

'AMAZON.CancelIntent': function () {
    this.shouldEndSession = true;
    this.emit(':tell', stopSkillMessage, stopSkillMessage);
},

'SaySomethingIntent': function () {

    var speechOutput= "Hello";
    var repromptOutput= "Say hello";
    var cardTitle="Hello. This is the card title.";
    var overviewMessage="This is a card.";
    this.askWithCard(speechOutput, repromptOutput, howToPlayCardTitle, overviewMessage);
},

'AskIntent': function () {

    var question="Hi there, what's your name?";
    this.askWithCard(question);
}
}

exports.handler = function (event, context) {

    var sample = new Sample();
    sample.execute(event, context);
};

` 任何 类型的帮助,甚至是使用 aws 的任何技巧,将不胜感激。谢谢

您的 Lambda 函数应该回调 AWS 以通知 Lambda 它已完成所有工作。

在 Lambda Nodejs 运行时的当前版本中,您可以调用处理程序的第三个参数,callback

http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-handler.html

在以前版本的 Nodejs 运行时,或者如果您的处理程序没有使用 callback 参数,您应该在它退出之前调用 context.succeed()context.fail()

http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-using-old-runtime.html