Permalink
Browse files

don't try catch unexpect call

  • Loading branch information...
1 parent 17b1003 commit 652f80232a2551751afdd3691452a62cbc3c4ba6 @JacksonTian JacksonTian committed Jan 12, 2013
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 652f802

Please sign in to comment.