diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2017-02-11 13:29:09 -0500 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2017-02-11 13:29:09 -0500 |
| commit | fe2504f6311c25689888e7d5b398087d55df99d8 (patch) | |
| tree | 22b4bcdd138aeb44f6c01c9b59745a29f67c9605 /www/js/WizardCtrl.js | |
| parent | 937117cdcdf12ab3d339da004013bfd5e3327aee (diff) | |
error handler enhanced #451
Diffstat (limited to 'www/js/WizardCtrl.js')
| -rw-r--r-- | www/js/WizardCtrl.js | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/www/js/WizardCtrl.js b/www/js/WizardCtrl.js index 537a6839..8f481d2d 100644 --- a/www/js/WizardCtrl.js +++ b/www/js/WizardCtrl.js @@ -153,10 +153,20 @@ angular.module('zmApp.controllers').controller('zmApp.WizardCtrl', ['$scope', '$ { NVRDataModel.log("Success: on " + urls[0] + t); //$ionicLoading.hide(); - return urls[0]; + d.resolve(urls[0]); + return d.promise; + //return urls[0]; }, function(err) { - NVRDataModel.log("zmWizard:Failed on " + urls[0] + t + " with error " + JSON.stringify(err)); + NVRDataModel.log("zmWizard:Failed on " + urls[0] + t + " with error " + JSON.stringify(err) ); + // this is actually a success - I might get empty status + // or something + if (err.status < 300) + { + NVRDataModel.log ("I am taking this as a cgi-bin success - "+urls[0]); + d.resolve(urls[0]); + return d.promise; + } return findFirstReachableUrl(urls.slice(1), tail); }); } @@ -302,7 +312,7 @@ angular.module('zmApp.controllers').controller('zmApp.WizardCtrl', ['$scope', '$ function(error) { $ionicLoading.hide(); - //console.log("No cgi-bin found: " + error); + console.log("No cgi-bin found: " + JSON.stringify(error)); $scope.wizard.streamingValidText = $translate.instant('kPortalCgiBinFailed'); $scope.wizard.streamingColor = "#e74c3c"; d.reject(false); |
