Add exception handling

This commit is contained in:
Joseph Schmitt 2016-03-27 18:02:00 -04:00
parent fee32d0bb7
commit b8145154ba

View File

@ -12,4 +12,11 @@ app.intent('AMAZON.YesIntent', handlers.handleYesIntent);
app.intent('AMAZON.NoIntent', handlers.handleNoIntent);
app.intent('AMAZON.CancelIntent', handlers.handleCancelIntent);
app.post = function(request, response, type, exception) {
if (exception) {
// Always turn an exception into a successful response
response.clear().say('An error occured: ' + exception).send();
}
};
module.exports = app;