{"size": 511, "ext": "js", "max_stars_repo_path": "lambda/handlers/ErrorHandler.js", "max_stars_repo_name": "dadeke/alexa-skill-meu-dividendo", "max_stars_repo_stars_event_min_datetime": "2021-07-06T14:21:42.000Z", "max_stars_repo_stars_event_max_datetime": "2021-07-06T14:21:42.000Z", "max_issues_repo_path": "lambda/handlers/ErrorHandler.js", "max_issues_repo_name": "dadeke/alexa-skill-meu-dividendo", "max_issues_repo_issues_event_min_datetime": "2022-01-26T11:07:27.000Z", "max_issues_repo_issues_event_max_datetime": "2022-01-26T11:07:27.000Z", "max_forks_repo_path": "lambda/handlers/ErrorHandler.js", "max_forks_repo_name": "dadeke/alexa-skill-meu-dividendo", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": 1, "max_forks_count": null, "avg_line_length": 25.55, "max_line_length": 68, "alphanum_fraction": 0.6927592955}
const speaks = require('../speakStrings');

const ErrorHandler = {
  canHandle() {
    return true;
  },
  async handle(handlerInput, error) {
    // eslint-disable-next-line no-console
    console.error('Error handled:', JSON.stringify(error));

    return handlerInput.responseBuilder
      .speak(speaks.VOICE_START + speaks.PROBLEM + speaks.VOICE_END)
      .withStandardCard(speaks.SKILL_NAME, speaks.PROBLEM)
      .withShouldEndSession(true)
      .getResponse();
  },
};

module.exports = ErrorHandler;
