Configure sonar code coverage; use EPSDK 1.3.0
[portal.git] / ecomp-portal-FE-common / client / app / views / errors / error.controller.js
diff --git a/ecomp-portal-FE-common/client/app/views/errors/error.controller.js b/ecomp-portal-FE-common/client/app/views/errors/error.controller.js
new file mode 100644 (file)
index 0000000..5f4f410
--- /dev/null
@@ -0,0 +1,20 @@
+'use strict';
+(function () {
+    class ErrorCtrl {
+        constructor($log, $scope,$state) {
+               $scope.errorState = $state.current.name;
+               if($scope.errorState=='root.error404'){
+                       $scope.errorTitle="Page Not Found";
+                       $scope.errorMsg="The page you are looking for cannot be found";
+               }else if($scope.errorState=='noUserError'){
+                       $scope.errorTitle="Authorization denied";
+                       $scope.errorMsg= "Please Contact Your Administrator for the page access";
+               }else {
+                       $scope.errorTitle="Something went wrong";
+                       $scope.errorMsg= "Please go back to the previous page";
+               }               
+        }
+    }
+    ErrorCtrl.$inject = ['$log','$scope','$state'];
+    angular.module('ecompApp').controller('ErrorCtrl', ErrorCtrl);
+})();
\ No newline at end of file