Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #726 from JacksonTian/fix_try_catch

don't try catch unexpect call
  • Loading branch information...
commit 5fb79944865d0f3056d0ef651f1055ab76835bc9 2 parents 36f3d8a + 652f802
@tj tj authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/middleware/json.js
View
6 lib/middleware/json.js
@@ -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();
});
});
- }
+ };
};
Please sign in to comment.
Something went wrong with that request. Please try again.