Merge pull request #44 from jonathanong/patch-1

pass context to errors
This commit is contained in:
TJ Holowaychuk 2013-08-31 09:17:09 -07:00
commit 9046d080be

View file

@ -1,4 +1,3 @@
/** /**
* Module dependencies. * Module dependencies.
*/ */
@ -592,12 +591,12 @@ module.exports = {
// handler and log. // handler and log.
if (this.headerSent) { if (this.headerSent) {
err.headerSent = true; err.headerSent = true;
this.app.emit('error', err); this.app.emit('error', err, this);
return; return;
} }
// delegate // delegate
this.app.emit('error', err); this.app.emit('error', err, this);
// err.status support // err.status support
if (err.status) { if (err.status) {