1

我有以下要上传到 lambda 的代码,它一直给我错误:“errorMessage”:“RequestId:bdfa695d-e8b8-11e6-952a-21bb5e95cff6 Process exited before completed 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 的提示,都将不胜感激。谢谢。

4

1 回答 1

4

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

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

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

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

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

于 2017-02-01T23:12:42.903 回答