From baefcacff99046fbe965e0c5682949753e31619b Mon Sep 17 00:00:00 2001 From: Kim Joar Bekkelund Date: Fri, 30 Aug 2013 23:09:18 +0200 Subject: [PATCH 1/2] typo --- lib/application.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/application.js b/lib/application.js index f260ece..a26e515 100644 --- a/lib/application.js +++ b/lib/application.js @@ -115,7 +115,7 @@ app.context = function(obj){ /** * Return a request handler callback - * for node's native htto server. + * for node's native http server. * * @return {Function} * @api public From a5208f5ce645481287595051485d3a02c3e7d918 Mon Sep 17 00:00:00 2001 From: Jonathan Ong Date: Fri, 30 Aug 2013 23:48:54 -0700 Subject: [PATCH 2/2] 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 +}