diff --git a/app/controllers/articles.server.controller.js b/app/controllers/articles.server.controller.js index 0a24e81733..e4fa5a4164 100644 --- a/app/controllers/articles.server.controller.js +++ b/app/controllers/articles.server.controller.js @@ -89,7 +89,11 @@ exports.list = function(req, res) { */ exports.articleByID = function(req, res, next, id) { Article.findById(id).populate('user', 'displayName').exec(function(err, article) { - if (err) return next(err); + if (err) { + return res.status(404).send({ + message: 'Article not found' + }); + } if (!article) return next(new Error('Failed to load article ' + id)); req.article = article; next();