diff --git a/lib/app.js b/lib/app.js index 67231bad..8cca2e35 100644 --- a/lib/app.js +++ b/lib/app.js @@ -73,9 +73,8 @@ module.exports = function (options) { config.isAuthorized(fingerprint, function (err, device) { if (err) { - var serverError = new Error('Internal Server Error'); - serverError.status = 500; - return next(serverError); + res.json({err: 'Internal Server Error'}); + return next(err); } if (!device) { res.statusCode = 404;