Permalink
Browse files

Merge pull request #726 from JacksonTian/fix_try_catch

don't try catch unexpect call
  • Loading branch information...
tj committed Jan 13, 2013
2 parents 36f3d8a + 652f802 commit 5fb79944865d0f3056d0ef651f1055ab76835bc9
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/middleware/json.js
View
@@ -74,13 +74,13 @@ exports = module.exports = function(options){
if (strict && '{' != first && '[' != first) return next(utils.error(400, 'invalid json'));
try {
req.body = JSON.parse(buf, options.reviver);
- next();
} catch (err){
err.body = buf;
err.status = 400;
- next(err);
+ return next(err);
}
+ next();
});
});
- }
+ };
};

0 comments on commit 5fb7994

Please sign in to comment.