summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
authorPliable Pixels <pliablepixels@gmail.com>2019-05-31 13:18:47 -0400
committerPliable Pixels <pliablepixels@gmail.com>2019-05-31 13:18:47 -0400
commit9ef6025aacefbee7bb457563df0ec28ab2698803 (patch)
treed13a7ac5e86e1870f89f63077441b91a3ae402b0 /www
parentdb03aaedefed847d7026b0964a487e3ee26f1bc1 (diff)
fix http intercept handler - was not returning errors correctly, resulting in 4xx returning in success
Diffstat (limited to 'www')
-rwxr-xr-xwww/js/app.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/www/js/app.js b/www/js/app.js
index 18bead17..90dfe96a 100755
--- a/www/js/app.js
+++ b/www/js/app.js
@@ -667,7 +667,7 @@ angular.module('zmApp', [
}
- return config;
+ return config || $q.when(config);
},
responseError: function (rejection) {
@@ -682,7 +682,7 @@ angular.module('zmApp', [
console.log ("MESSAGE:"+rejection.data.data.message);
if (rejection.data.data.message.indexOf('API Disabled') != -1) {
$rootScope.apiValid = false;
- return rejection;
+ return $q.reject(rejection);
}
}
@@ -700,12 +700,12 @@ angular.module('zmApp', [
return $injector.get('$http')(rejection.config);
}, function (err) {
nvr.log ("Interception proceedWithLogin failed, NOT retrying old request");
- return err;
+ return $q.reject(err);
});
}
else {
if (rejection.config.skipIntercept) nvr.log ("Not intercepting as skipIntercept true");
- return rejection;
+ return $q.reject(rejection);
}
},
@@ -737,7 +737,7 @@ angular.module('zmApp', [
// console.log ("FIXED="+JSON.stringify(response.data));
}
//"data":"<pre class=\"cake-error\">
- return response;
+ return response || $q.when(response);
}
};