return json on all server errors
This commit is contained in:
parent
955cc634a2
commit
72e7c8addc
1 changed files with 2 additions and 3 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue