Update index.js

This commit is contained in:
Tom Moor
2019-03-07 20:47:37 -08:00
committed by GitHub
parent 3db1a6679a
commit e3cb7f9055

View File

@ -88,12 +88,12 @@ if (process.env.NODE_ENV === 'development') {
bugsnag.register(process.env.BUGSNAG_KEY, { bugsnag.register(process.env.BUGSNAG_KEY, {
filters: ['authorization'], filters: ['authorization'],
}); });
app.on('error', error => { app.on('error', (error, ctx) => {
// we don't need to report every time a request stops to the bug tracker // we don't need to report every time a request stops to the bug tracker
if (error.code === 'EPIPE' || error.code === 'ECONNRESET') { if (error.code === 'EPIPE' || error.code === 'ECONNRESET') {
logger.warn('Connection error', { error }); logger.warn('Connection error', { error });
} else { } else {
bugsnag.koaHandler(error); bugsnag.koaHandler(error, ctx);
} }
}); });
} }