1.0.3 • Published 4 years ago

@beforeyoubid/exception-handler v1.0.3

Weekly downloads
5
License
ISC
Repository
github
Last release
4 years ago

Sentry Lambda Exception Handler

This npm module can be used to wrap over the existing lambda function. When it's enabled, it will capture all exceptions and report to Sentry.

Installation

yarn add @beforeyoubid/exception-handler

We follow 12-factors and we can enable this using environment variables.

  SENTRY_DSN=https://xxxx@yyyy.ingest.sentry.io/zzzz

Usage by Using Lambda Asynchronous Handler

import { asyncSentryHandler } from '@beforeyoubid/exception-handler';

export default asyncSentryHandler(serverless(app));

Usage by Using Lambda Callback Handler

import { callbackSentryHandler } from '@beforeyoubid/exception-handler';

export default callbackSentryHandler(serverless(app));