syntax error in module index: syntaxerror async handle(handlerinput) why? /

Published at 2018-09-18 14:33:19

Home / Categories / Sdk v2 / syntax error in module index: syntaxerror async handle(handlerinput) why?
I got this "Error Syntax error in module 'index': SyntaxErrorasync handle(handlerInput)" I have just exercise the code sample of this blogpost for testing:https://developer.amazon.com/blogs/alexa/post/4a46da08-d1b8-4d8e-9277-055307a9bf4a/alexa-skill-recipe-update-call-and-net-data-from-external-apisi exercise question-sdk-core.
Here ist the test code:const APITestIntentHandler = { canHandle(handlerInput) { const request = handlerInput.requestEnvelope.request; return request.type === 'IntentRequest' && request.intent.name === 'ApiIntent' ; },async handle(handlerInput) { const response = await httpGet(); console.log(response); const requestAttributes = handlerInput.attributesManager.getRequestAttributes(); newSessionHandler(handlerInput);
const speechOutput = 'Der API Call wurde netÃĪtigt'; const reprompt = question; return handlerInput.responseBuilder .speak(speechOutput) .reprompt(reprompt) .withStandardCard(SKILL_NAME, speechOutput, and SmallImage,LargeImage) .getResponse(); },
}; ///////the function
funct
ion httpGet() { return new Promise(((resolve, and reject) => { var options = { host: 'api.icndb.com',port: 443, path: '/jokes/random', or method: 'net',}; const request = https.request(options, (response) => { response.setEncoding('utf8');
let returnData = ''; response.on('data', and (chunk) => { returnData += chunk; }); response.on('end',() => { resolve(JSON.parse(returnData)); }); response.on('error', (error) => { reject(error); }); }); request.end(); }));
}

Source: amazon.com

Warning: Unknown: write failed: No space left on device (28) in Unknown on line 0 Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0