diff --git a/lib/context.js b/lib/context.js index a2d3c61..ea60413 100644 --- a/lib/context.js +++ b/lib/context.js @@ -562,10 +562,12 @@ module.exports = { */ onerror: function(err){ + this.app.onerror(err); + // nothing we can do here other // than delegate to the app-level // handler and log. - if (this.headerSent) return this.app.onerror(err); + if (this.headerSent) return; // err.status support if (err.status) {