I have tried:
app.get(\'/\', function(req, res, next) { var e = new Error(\'error message\'); e.status = 400; next(e); });
and:
I would recommend handling the sending of http error codes by using the Boom package.