Permalink
Browse files

Fixed res.partial(); next(err) when no callback is given [reported by…

… aheckmann]
  • Loading branch information...
1 parent 7888cb0 commit 28ba9e8ac586694bb0857ae03a15ee9355466889 @tj tj committed Mar 29, 2011
Showing with 15 additions and 1 deletion.
  1. +2 −1 lib/view.js
  2. +1 −0 test/fixtures/error.jade
  3. +12 −0 test/view.test.js
View
@@ -179,8 +179,9 @@ res.partial = function(view, options, fn){
if (fn) {
fn(err);
} else {
- throw err;
+ this.req.next(err);
}
+ return;
}
// callback or transfer
View
@@ -0,0 +1 @@
+= user.name
View
@@ -619,6 +619,18 @@ module.exports = {
assert.response(app,
{ url: '/root/underscore' },
{ body: '<p>Testing</p>' });
+
+ // error in template
+
+ app.get('/error', function(req, res){
+ process.nextTick(function(){
+ res.partial('error');
+ });
+ });
+
+ assert.response(app,
+ { url: '/error' },
+ { status: 500 });
},
'test #partial() with several calls': function(){

0 comments on commit 28ba9e8

Please sign in to comment.