From a5208f5ce645481287595051485d3a02c3e7d918 Mon Sep 17 00:00:00 2001 From: Jonathan Ong Date: Fri, 30 Aug 2013 23:48:54 -0700 Subject: [PATCH] pass context to errors errors are kind of useless without the context --- lib/context.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/context.js b/lib/context.js index 5cb1cf3..fda7cdd 100644 --- a/lib/context.js +++ b/lib/context.js @@ -1,4 +1,3 @@ - /** * Module dependencies. */ @@ -592,12 +591,12 @@ module.exports = { // handler and log. if (this.headerSent) { err.headerSent = true; - this.app.emit('error', err); + this.app.emit('error', err, this); return; } // delegate - this.app.emit('error', err); + this.app.emit('error', err, this); // err.status support if (err.status) { @@ -915,4 +914,4 @@ function escape(html) { .replace(/"/g, '"') .replace(//g, '>'); -} \ No newline at end of file +}