From 83d23ed2a4b7b210639f4e1a9ba7644bd6e53505 Mon Sep 17 00:00:00 2001 From: Nathan Leniz Date: Tue, 24 Mar 2015 18:28:02 +0900 Subject: [PATCH] Remove sending 500 response to user manually and rely on middleware instead --- controllers/story.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/controllers/story.js b/controllers/story.js index a90694d6d6..34a85a6669 100644 --- a/controllers/story.js +++ b/controllers/story.js @@ -49,7 +49,6 @@ exports.recentJSON = function(req, res, next) { var story = Story.find({}).sort({'timePosted': -1}).limit(100); story.exec(function(err, stories) { if (err) { - res.sendStatus(500); return next(err); } return res.json(stories); @@ -215,7 +214,6 @@ exports.upvote = function(req, res, next) { var data = req.body.data; Story.find({'_id': data.id}, function(err, story) { if (err) { - res.sendStatus(500); return next(err); } story = story.pop(); @@ -245,7 +243,6 @@ exports.comments = function(req, res, next) { var data = req.params.id; Comment.find({'_id': data}, function(err, comment) { if (err) { - res.sendStatus(500); return next(err); } comment = comment.pop();