Handle random non-error errors

This commit is contained in:
Jonathan Cremin 2019-03-12 00:29:47 +00:00
parent 62101e7739
commit b8b01a817a

6
app.js
View file

@ -33,8 +33,10 @@ if (process.env.NODE_ENV === 'production') {
app.proxy = true;
}
app.on('error', (err, ctx) => {
Sentry.captureException(err);
app.on('error', (err) => {
if (!err.status || err.status >= 500) {
Sentry.captureException(err);
}
});
app.use(errorHandler(Sentry));