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) {
|
config.isAuthorized(fingerprint, function (err, device) {
|
||||||
if (err) {
|
if (err) {
|
||||||
var serverError = new Error('Internal Server Error');
|
res.json({err: 'Internal Server Error'});
|
||||||
serverError.status = 500;
|
return next(err);
|
||||||
return next(serverError);
|
|
||||||
}
|
}
|
||||||
if (!device) {
|
if (!device) {
|
||||||
res.statusCode = 404;
|
res.statusCode = 404;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue