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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -88,12 +88,12 @@ if (process.env.NODE_ENV === 'development') {
bugsnag.register(process.env.BUGSNAG_KEY, {
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
if (error.code === 'EPIPE' || error.code === 'ECONNRESET') {
logger.warn('Connection error', { error });
} else {
bugsnag.koaHandler(error);
bugsnag.koaHandler(error, ctx);
}
});
}