Advertisement
Guest User

Untitled

a guest
Apr 20th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. const Alexa = require('ask-sdk');
  2.  
  3. const HelloHandler = {
  4. canHandle(handlerInput) {
  5.  
  6. },
  7. handle(handlerInput) {
  8.  
  9. }
  10. };
  11.  
  12. const ErrorHandler = {
  13. canHandle(handlerInput, error) {
  14. return true; // Handle all errors
  15. },
  16. handle(handlerInput, error) {
  17. console.log(`Error handled: ${error.message}`);
  18. console.log(error.trace);
  19.  
  20. return handlerInput.responseBuilder
  21. .speak('Sorry, I can\'t understand the command. Please say again.')
  22. .getResponse();
  23. },
  24. }
  25. };
  26.  
  27. const skillBuilder = Alexa.SkillBuilders.custom();
  28.  
  29. exports.handler = skillBuilder
  30. .addRequestHandlers(
  31. HelloHandler
  32. )
  33. .addErrorHandlers(ErrorHandler)
  34. .lambda();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement