diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2019-05-31 13:18:47 -0400 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2019-05-31 13:18:47 -0400 |
| commit | 9ef6025aacefbee7bb457563df0ec28ab2698803 (patch) | |
| tree | d13a7ac5e86e1870f89f63077441b91a3ae402b0 /www/js | |
| parent | db03aaedefed847d7026b0964a487e3ee26f1bc1 (diff) | |
fix http intercept handler - was not returning errors correctly, resulting in 4xx returning in success
Diffstat (limited to 'www/js')
| -rwxr-xr-x | www/js/app.js | 10 |
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); } }; |
