You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aurora.apache.org by ma...@apache.org on 2014/04/05 02:05:18 UTC

[32/50] [abbrv] git commit: Updated error handling logic.

Updated error handling logic.


Project: http://git-wip-us.apache.org/repos/asf/incubator-aurora/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-aurora/commit/d47bf51a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-aurora/tree/d47bf51a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-aurora/diff/d47bf51a

Branch: refs/heads/mansu/job_page
Commit: d47bf51a5d2ab524b1473f9f3dbb897ed6fe6c9e
Parents: 7d64f87
Author: Suman Karumuri <sk...@twitter.com>
Authored: Sun Mar 30 17:33:24 2014 -0700
Committer: Suman Karumuri <sk...@twitter.com>
Committed: Sun Mar 30 17:33:24 2014 -0700

----------------------------------------------------------------------
 .../org/apache/aurora/scheduler/http/ui/js/controllers.js    | 8 ++++----
 .../org/apache/aurora/scheduler/http/ui/js/services.js       | 5 +++--
 2 files changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/d47bf51a/src/main/resources/org/apache/aurora/scheduler/http/ui/js/controllers.js
----------------------------------------------------------------------
diff --git a/src/main/resources/org/apache/aurora/scheduler/http/ui/js/controllers.js b/src/main/resources/org/apache/aurora/scheduler/http/ui/js/controllers.js
index 153e319..fbff218 100644
--- a/src/main/resources/org/apache/aurora/scheduler/http/ui/js/controllers.js
+++ b/src/main/resources/org/apache/aurora/scheduler/http/ui/js/controllers.js
@@ -27,7 +27,7 @@ auroraUIControllers.controller('RoleSummaryController',
     $scope.roleSummaries = parseResponse(auroraClient.getRoleSummary());
 
     function parseResponse(response) {
-      $scope.error = response.error ? 'Error requesting role summary: ' + response.errorMsg : '';
+      $scope.error = response.error ? 'Error requesting role summary: ' + response.error : '';
 
       if ($scope.error) {
         return [];
@@ -101,7 +101,7 @@ auroraUIControllers.controller('JobSummaryController',
 
     function getJobs() {
       var summaries = auroraClient.getJobSummary($scope.role);
-      $scope.error = summaries.error ? 'Error fetching job summaries: ' + summaries.errorMsg : '';
+      $scope.error = summaries.error ? 'Error fetching job summaries: ' + summaries.error : '';
 
       if ($scope.error) {
         return [];
@@ -229,9 +229,9 @@ auroraUIControllers.controller('QuotaController',
 
     function getQuota() {
       var quotaResponse = auroraClient.getQuota($scope.role);
-      $scope.error = quotaResponse.error ? 'Error fetching quota: ' + quotaResponse.errorMsg : '';
+      $scope.error = quotaResponse.error ? 'Error fetching quota: ' + quotaResponse.error : '';
 
-      if (quotaResponse.error) {
+      if ($scope.error) {
         return [];
       }
 

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/d47bf51a/src/main/resources/org/apache/aurora/scheduler/http/ui/js/services.js
----------------------------------------------------------------------
diff --git a/src/main/resources/org/apache/aurora/scheduler/http/ui/js/services.js b/src/main/resources/org/apache/aurora/scheduler/http/ui/js/services.js
index c171e74..a446d23 100644
--- a/src/main/resources/org/apache/aurora/scheduler/http/ui/js/services.js
+++ b/src/main/resources/org/apache/aurora/scheduler/http/ui/js/services.js
@@ -44,8 +44,9 @@ auroraUI.factory(
         processResponse: function (response) {
           this.setPageTitle(response.serverInfo);
           return {
-            error: response.responseCode !== 1,
-            errorMsg: response.message
+            error: response.responseCode !== 1
+              ? (response.message || 'No error message returned by the scheduler')
+              : ''
           }
         },