You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by an...@apache.org on 2015/07/03 10:51:39 UTC

incubator-ignite git commit: # ignite-843 Add internal server error.

Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-843 d38e5de68 -> 8a4864ea7


# ignite-843 Add internal server error.


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

Branch: refs/heads/ignite-843
Commit: 8a4864ea70eaeaa275db0331cb1c0e865aeeba2e
Parents: d38e5de
Author: Andrey <an...@gridgain.com>
Authored: Fri Jul 3 15:51:37 2015 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Fri Jul 3 15:51:37 2015 +0700

----------------------------------------------------------------------
 .../nodejs/public/javascripts/controllers/caches.js  | 15 +++++++++++----
 .../public/javascripts/controllers/clusters.js       | 15 +++++++++++----
 .../nodejs/public/javascripts/controllers/common.js  | 14 ++++++++------
 .../public/javascripts/controllers/persistences.js   | 15 +++++++++++----
 4 files changed, 41 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8a4864ea/modules/web-control-center/nodejs/public/javascripts/controllers/caches.js
----------------------------------------------------------------------
diff --git a/modules/web-control-center/nodejs/public/javascripts/controllers/caches.js b/modules/web-control-center/nodejs/public/javascripts/controllers/caches.js
index 45c4f9a..8e1d775 100644
--- a/modules/web-control-center/nodejs/public/javascripts/controllers/caches.js
+++ b/modules/web-control-center/nodejs/public/javascripts/controllers/caches.js
@@ -19,6 +19,7 @@ configuratorModule.controller('cachesController', ['$scope', '$alert', '$http',
         $scope.swapSimpleItems = commonFunctions.swapSimpleItems;
         $scope.joinTip = commonFunctions.joinTip;
         $scope.getModel = commonFunctions.getModel;
+        $scope.errorMessage = commonFunctions.errorMessage;
 
         $scope.atomicities = [
             {value: 'ATOMIC', label: 'ATOMIC'},
@@ -79,6 +80,9 @@ configuratorModule.controller('cachesController', ['$scope', '$alert', '$http',
             .success(function (data) {
                 $scope.general = data.general;
                 $scope.advanced = data.advanced;
+            })
+            .error(function (errMsg) {
+                $alert({title: $scope.errorMessage(errMsg)});
             });
 
         $scope.caches = [];
@@ -106,6 +110,9 @@ configuratorModule.controller('cachesController', ['$scope', '$alert', '$http',
                     if (val)
                         sessionStorage.cacheBackupItem = angular.toJson(val);
                 }, true);
+            })
+            .error(function (errMsg) {
+                $alert({title: $scope.errorMessage(errMsg)});
             });
 
         $scope.selectItem = function (item) {
@@ -161,8 +168,8 @@ configuratorModule.controller('cachesController', ['$scope', '$alert', '$http',
                         container: '#save-btn'
                     });
                 })
-                .error(function (errorMessage) {
-                    $alert({title: errorMessage});
+                .error(function (errMsg) {
+                    $alert({title: $scope.errorMessage(errMsg)});
                 });
         };
 
@@ -182,8 +189,8 @@ configuratorModule.controller('cachesController', ['$scope', '$alert', '$http',
                         $scope.backupItem = undefined;
                     }
                 })
-                .error(function (errorMessage) {
-                    $alert({title: errorMessage});
+                .error(function (errMsg) {
+                    $alert({title: $scope.errorMessage(errMsg)});
                 });
         };
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8a4864ea/modules/web-control-center/nodejs/public/javascripts/controllers/clusters.js
----------------------------------------------------------------------
diff --git a/modules/web-control-center/nodejs/public/javascripts/controllers/clusters.js b/modules/web-control-center/nodejs/public/javascripts/controllers/clusters.js
index 3186eb7..e047ac2 100644
--- a/modules/web-control-center/nodejs/public/javascripts/controllers/clusters.js
+++ b/modules/web-control-center/nodejs/public/javascripts/controllers/clusters.js
@@ -19,6 +19,7 @@ configuratorModule.controller('clustersController', ['$scope', '$alert', '$http'
         $scope.swapSimpleItems = commonFunctions.swapSimpleItems;
         $scope.joinTip = commonFunctions.joinTip;
         $scope.getModel = commonFunctions.getModel;
+        $scope.errorMessage = commonFunctions.errorMessage;
 
         $scope.templates = [
             {value: {}, label: 'none'},
@@ -92,6 +93,9 @@ configuratorModule.controller('clustersController', ['$scope', '$alert', '$http'
 
                 $scope.general = data.general;
                 $scope.advanced = data.advanced;
+            })
+            .error(function (errMsg) {
+                $alert({title: $scope.errorMessage(errMsg)});
             });
 
         // When landing on the page, get clusters and show them.
@@ -118,6 +122,9 @@ configuratorModule.controller('clustersController', ['$scope', '$alert', '$http'
                     if (val)
                         sessionStorage.clusterBackupItem = angular.toJson(val);
                 }, true);
+            })
+            .error(function (errMsg) {
+                $alert({title: $scope.errorMessage(errMsg)});
             });
 
         $scope.selectItem = function (item) {
@@ -178,8 +185,8 @@ configuratorModule.controller('clustersController', ['$scope', '$alert', '$http'
                         container: '#save-btn'
                     });
                 })
-                .error(function (errorMessage) {
-                    $alert({title: errorMessage});
+                .error(function (errMsg) {
+                    $alert({title: $scope.errorMessage(errMsg)});
                 });
         };
 
@@ -199,8 +206,8 @@ configuratorModule.controller('clustersController', ['$scope', '$alert', '$http'
                         $scope.backupItem = undefined;
                     }
                 })
-                .error(function (errorMessage) {
-                    $alert({title: errorMessage});
+                .error(function (errMsg) {
+                    $alert({title: $scope.errorMessage(errMsg)});
                 });
         };
     }]

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8a4864ea/modules/web-control-center/nodejs/public/javascripts/controllers/common.js
----------------------------------------------------------------------
diff --git a/modules/web-control-center/nodejs/public/javascripts/controllers/common.js b/modules/web-control-center/nodejs/public/javascripts/controllers/common.js
index 8fec94d..154eafd 100644
--- a/modules/web-control-center/nodejs/public/javascripts/controllers/common.js
+++ b/modules/web-control-center/nodejs/public/javascripts/controllers/common.js
@@ -62,6 +62,9 @@ configuratorModule.service('commonFunctions', function () {
             });
 
             return lines.join("");
+        },
+        errorMessage: function(errMsg) {
+            return errMsg ? errMsg : 'Internal server error.';
         }
     }
 });
@@ -137,10 +140,11 @@ configuratorModule.controller('activeLink', ['$scope', function ($scope) {
     };
 }]);
 
-configuratorModule.controller('auth', ['$scope', '$modal', '$alert', '$http', '$window', function ($scope, $modal, $alert, $http, $window) {
-    $scope.action = 'login';
+configuratorModule.controller('auth', ['$scope', '$modal', '$alert', '$http', '$window', 'commonFunctions',
+    function ($scope, $modal, $alert, $http, $window, commonFunctions) {
+    $scope.errorMessage = commonFunctions.errorMessage;
 
-    $scope.errorMessage = '';
+    $scope.action = 'login';
 
     $scope.valid = false;
 
@@ -160,9 +164,7 @@ configuratorModule.controller('auth', ['$scope', '$modal', '$alert', '$http', '$
                 $window.location = '/clusters';
             })
             .error(function (data) {
-                console.log(data);
-
-                $alert({placement: 'top', container: '#errors-container', title: data});
+                $alert({placement: 'top', container: '#errors-container', title: $scope.errorMessage(data)});
             });
     };
 }]);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8a4864ea/modules/web-control-center/nodejs/public/javascripts/controllers/persistences.js
----------------------------------------------------------------------
diff --git a/modules/web-control-center/nodejs/public/javascripts/controllers/persistences.js b/modules/web-control-center/nodejs/public/javascripts/controllers/persistences.js
index 10e3f8f..0b9b78c 100644
--- a/modules/web-control-center/nodejs/public/javascripts/controllers/persistences.js
+++ b/modules/web-control-center/nodejs/public/javascripts/controllers/persistences.js
@@ -18,6 +18,7 @@
 configuratorModule.controller('persistenceController', ['$scope', '$alert', '$http', 'commonFunctions', function ($scope, $alert, $http, commonFunctions) {
         $scope.joinTip = commonFunctions.joinTip;
         $scope.getModel = commonFunctions.getModel;
+        $scope.errorMessage = commonFunctions.errorMessage;
 
         $scope.databases = [
             {value: 'oracle', label: 'Oracle database'},
@@ -33,6 +34,9 @@ configuratorModule.controller('persistenceController', ['$scope', '$alert', '$ht
         $http.get('/form-models/persistence.json')
             .success(function (data) {
                 $scope.connection = data.connection;
+            })
+            .error(function (errMsg) {
+                $alert({title: $scope.errorMessage(errMsg)});
             });
 
         $scope.persistences = [];
@@ -60,6 +64,9 @@ configuratorModule.controller('persistenceController', ['$scope', '$alert', '$ht
                     if (val)
                         sessionStorage.persistenceBackupItem = angular.toJson(val);
                 }, true);
+            })
+            .error(function (errMsg) {
+                $alert({title: $scope.errorMessage(errMsg)});
             });
 
         $scope.selectItem = function (item) {
@@ -93,8 +100,8 @@ configuratorModule.controller('persistenceController', ['$scope', '$alert', '$ht
 
                     $scope.selectItem(item);
                 })
-                .error(function (errorMessage) {
-                    $alert({title: errorMessage});
+                .error(function (errMsg) {
+                    $alert({title: $scope.errorMessage(errMsg)});
                 });
         };
 
@@ -114,8 +121,8 @@ configuratorModule.controller('persistenceController', ['$scope', '$alert', '$ht
                         $scope.backupItem = undefined;
                     }
                 })
-                .error(function (errorMessage) {
-                    $alert({title: errorMessage});
+                .error(function (errMsg) {
+                    $alert({title: $scope.errorMessage(errMsg)});
                 });
         };