1.0.3 • Published 5 years ago
@beforeyoubid/exception-handler v1.0.3
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-handlerWe follow 12-factors and we can enable this using environment variables.
SENTRY_DSN=https://xxxx@yyyy.ingest.sentry.io/zzzzUsage 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));