diff --git a/lib/node-http-proxy.js b/lib/node-http-proxy.js index c1275ab..b5de6bb 100644 --- a/lib/node-http-proxy.js +++ b/lib/node-http-proxy.js @@ -294,7 +294,7 @@ exports.stack = function stack (middlewares, proxy) { handle = function (req, res) { var next = function (err) { if (err) { - if (! proxy.emit('middlewareError', err, res, req)) { + if (! proxy.emit('middlewareError', err, req, res)) { console.error('Error in middleware(s): %s', err.stack); }