Skip to content

Commit

Permalink
use error handler on middleware error
Browse files Browse the repository at this point in the history
  • Loading branch information
jkyberneees committed Jun 18, 2019
1 parent ed18f7d commit 86c5578
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libs/middleware-chain.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const next = (middlewares, req, res, errorHandler) => {
const middleware = middlewares.shift()

return (err) => {
if (err) return res.send(err)
if (err) return errorHandler(err, req, res)
if (res.statusCode === 200 && !res.finished) {
if (!middleware) return

Expand Down

0 comments on commit 86c5578

Please sign in to comment.