This is a middy middleware, which is reporting errors to Sentry. Http errors are not reported.
npm install @joblocal/middy-sentry-error-handler
# 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.