From fe2504f6311c25689888e7d5b398087d55df99d8 Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Sat, 11 Feb 2017 13:29:09 -0500 Subject: error handler enhanced #451 --- www/js/WizardCtrl.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'www/js/WizardCtrl.js') 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); -- cgit v1.2.3