@ask-utils/error-handlers
TypeScript icon, indicating that this package has built-in type declarations

3.9.0 • Public • Published

ASK Utils for Error Handler

npm version License: MIT Maintainability Test Coverage Build Status logo

https://ask-utils.dev

Getting started

$ npm i -S @ask-utils/error-handlers

Requirement

You SHOULD set the environment variable in your env (Lambda, Container, etc..)

SENTRY_DNS=YOUR_SENTRY_DNS

Basic Usage

import Alexa from 'ask-sdk'
import { SetErrorTrackerInterceptor, SentryDefaultErrorHandler } from '@ask-utils/error-handlers'

export const handler = Alexa.SkillBuilders.standard()
            .addErrorHandlers(SentryDefaultErrorHandler)
            .addRequestInterceptors(SetErrorTrackerInterceptor)
            .lambda()

Custom Usage

const ErrorHandler = SentryErrorHandlerFactory.init()
        .setHandle((handlerInput, error) => {
          console.log('Stack: %j', error.stack)
          return handlerInput.responseBuilder
            .speak('Sorry I could not understand the meaning. Please tell me again')
            .reprompt('Could you tell me onece more?')
            .getResponse()
        })
        .getHandler()

Readme

Keywords

none

Package Sidebar

Install

npm i @ask-utils/error-handlers

Weekly Downloads

12

Version

3.9.0

License

MIT

Unpacked Size

10.3 kB

Total Files

7

Last publish

Collaborators

  • hideokamoto