Reputation: 53
I have the following code that I'm uploading to lambda, and it keeps giving me the error: "errorMessage": "RequestId: bdfa695d-e8b8-11e6-952a-21bb5e95cff6 Process exited before completing request", even though I've modified this code from a perfectly working skill. The code simply tells the user hello (with a card), and can ask them a question when the user says asks me a question. Here is my code: `
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);
};
` Help of any kind, or even any tips for working with aws, would be much appreciated. Thanks.
Upvotes: 1
Views: 3842
Reputation: 36103
Your Lambda function should call back to AWS to inform Lambda that it's done all it's work.
In current versions of the Lambda Nodejs runtime, you can call the 3rd parameter to your handler, callback
.
http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-handler.html
In previous versions of the Nodejs runtime, or if your handler is not taking the callback
parameter, you should call context.succeed()
or context.fail()
before it exits.
http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-using-old-runtime.html
Upvotes: 4