@joblocal/middy-sentry-error-handler
v1.0.5
Published
A middy middleware to report errors to Sentry.
Downloads
3,249
Keywords
Readme
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://[email protected]/283203',
}));
module.exports = { handler };
The options you are passing correspond to the Sentry init options.