I have the following Middleware to protect my get-route.
function isAdmin(req, res, next) {
    if(req.user.role == "admin") {
        return next();
    }
    return res.send(404);
}
Is the way I send the error correct?
And this is my API call:
$scope.users = APIService.query({ route:'users' });
How, can I catch the 404 and do some stuff?
Thanks!
 
     
     
    