Skip to content

Commit

Permalink
fix(plugin-express): Ensure HTTP status is 500 when crashing
Browse files Browse the repository at this point in the history
The wrong property was being used in attempt to set the HTTP status code. This fixes it for Express
and Connect (connect doesn't have the method res.status()).

Fixes #510.
  • Loading branch information
bengourley committed Apr 2, 2019
1 parent c2020c6 commit 687f7d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/plugin-express/src/express.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ module.exports = {
req.bugsnag.config.onUncaughtException(err, report, client._logger)
})
if (!res.headersSent) {
res.status = 500
res.statusCode = 500
res.end('Internal server error')
}
})
Expand Down

0 comments on commit 687f7d7

Please sign in to comment.