alexa-js / alexa-app

A framework for Alexa (Amazon Echo) apps using Node.js
https://www.youtube.com/watch?v=pzM4jv7k7Rg
MIT License
1.03k stars 212 forks source link

Is there a way to trap unhandled intents? #337

Closed roschler closed 6 years ago

roschler commented 6 years ago

I got my first round trip working between my test Alexa skill and my alexa-app handler code. Unfortunately, the intent I defined in the management console was not one I had a handler for since it was a custom intent name I created. I saw this in the management console test results:

{
  "version": "1.0",
  "response": {
    "directives": [],
    "shouldEndSession": true,
    "outputSpeech": {
      "type": "SSML",
      "ssml": "<speak>Sorry, the application didn't know what to do with that intent</speak>"
    }
  },
  "sessionAttributes": {}
}

Is there a way to define an error handler function to catch unhandled intents that will be fired if an INTENT is received? If it weren't for that result above, I wouldn't have known about the unhandled INTENT since I didn't see anything in the Console/Log window of my Node.JS IDE.

tejashah88 commented 6 years ago

Recently, Amazon has released a new intent for the purpose of handling phrases that shouldn't be handled via AMAZON.FallbackIntent (only for US English). As for handling unimplemented intents, alexa-app will throw a "NO_INTENT_FOUND" error and you can customize the error message here.