diff --git a/lib/api/routes.js b/lib/api/routes.js index 5e2c0ff..0cf5ee6 100644 --- a/lib/api/routes.js +++ b/lib/api/routes.js @@ -20,21 +20,21 @@ var load = function load(req, res, next) { if (robot) { req.robot = Cylon.robots[robot]; if (!req.robot) { - return res.json({ error: "No Robot found with the name " + robot }); + return res.json(404, { error: "No Robot found with the name " + robot }); } } if (device) { req.device = req.robot.devices[device]; if (!req.device) { - return res.json({ error: "No device found with the name " + device }); + return res.json(404, { error: "No device found with the name " + device }); } } if (connection) { req.connection = req.robot.connections[connection]; if (!req.connection) { - return res.json({ error: "No connection found with the name " + connection }); + return res.json(404, { error: "No connection found with the name " + connection }); } }