From 50d73e3709d9d46985bc3e0e52ebdadcc2e0d95c Mon Sep 17 00:00:00 2001 From: Jonathan Ong Date: Tue, 8 Oct 2013 23:23:14 -0700 Subject: [PATCH] onerror: check existence of error --- lib/context.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/context.js b/lib/context.js index 12762e3..1eba80d 100644 --- a/lib/context.js +++ b/lib/context.js @@ -644,6 +644,11 @@ module.exports = { */ onerror: function(err){ + // don't do anything if there is no error. + // this allows you to pass `this.onerror` + // to node-style callbacks. + if (!err) return; + // nothing we can do here other // than delegate to the app-level // handler and log.