1.0.5 • Published 4 years ago

@joblocal/middy-sentry-error-handler v1.0.5

Weekly downloads
86
License
ISC
Repository
-
Last release
4 years ago

Middy Sentry Error Middleware

This is a middy middleware, which is reporting errors to Sentry. Http errors are not reported.

Installation

npm install @joblocal/middy-sentry-error-handler

Usage

# handler.js
const middy = require('middy');
const sentryErrorHandler = require('@joblocal/middy-sentry-error-handler');

const yourHandler = () => {
  throw new Error('this will be reported to sentry');
};

const handler = middy(yourHandler)
  .use(sentryErrorHandler({
    dsn: 'https://62f4e2311cea4c5da1e3e681b9014926@sentry.io/283203',
  }));

module.exports = { handler };

The options you are passing correspond to the Sentry init options.

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

5 years ago

1.0.0

5 years ago