You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by is...@apache.org on 2014/08/28 11:57:34 UTC

[03/50] [abbrv] git commit: propagating the backend error messages to UI when subscribing

propagating the backend error messages to UI when subscribing


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/1ac1819e
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/1ac1819e
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/1ac1819e

Branch: refs/heads/4.0.0-grouping
Commit: 1ac1819e3090e153a9120b24ebe9afcb0858ff37
Parents: ee75407
Author: Udara Liyanage <ud...@wso2.com>
Authored: Mon Aug 18 12:57:56 2014 +0530
Committer: Udara Liyanage <ud...@wso2.com>
Committed: Mon Aug 18 12:57:56 2014 +0530

----------------------------------------------------------------------
 .../console/controllers/cartridgeSubscribeSubmit.jag          | 7 +++++--
 .../org.apache.stratos.manager.console/console/index.jag      | 7 +++++++
 2 files changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/1ac1819e/components/org.apache.stratos.manager.console/console/controllers/cartridgeSubscribeSubmit.jag
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/controllers/cartridgeSubscribeSubmit.jag b/components/org.apache.stratos.manager.console/console/controllers/cartridgeSubscribeSubmit.jag
index 888b2cb..48af400 100644
--- a/components/org.apache.stratos.manager.console/console/controllers/cartridgeSubscribeSubmit.jag
+++ b/components/org.apache.stratos.manager.console/console/controllers/cartridgeSubscribeSubmit.jag
@@ -111,7 +111,7 @@
 
                     var re = utils.consoleAppUtil.subscribeToCartridge(jsonRequest);
                     if(re.Error != undefined){
-                            error.push(step_data.Error);
+			session.put("errorinbackend", re.Error);                        
                     } else {
                         log.debug("Request :" + stringify(jsonRequest) + ",  \n Response : " + stringify(re)) ;
                         // check if the repo Url returned in response is valid. If so, assign it to a variable to use in the next
@@ -127,8 +127,11 @@
         }
 
     } else {
-	 jsonRequest.cartridgeType = cartridgeType;
+        jsonRequest.cartridgeType = cartridgeType;
         var result = utils.consoleAppUtil.subscribeToCartridge(jsonRequest);
+        if(result.Error != undefined){
+              session.put("errorinbackend", result.Error);
+	}
    }
 
     response.sendRedirect(request.getContextPath() + '/index.jag');

http://git-wip-us.apache.org/repos/asf/stratos/blob/1ac1819e/components/org.apache.stratos.manager.console/console/index.jag
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/index.jag b/components/org.apache.stratos.manager.console/console/index.jag
index 7c4149f..e99bcd1 100644
--- a/components/org.apache.stratos.manager.console/console/index.jag
+++ b/components/org.apache.stratos.manager.console/console/index.jag
@@ -26,6 +26,13 @@ var utils = require('/util/utility.jag');
 var process = require('process');
 
 var subscribedCartridges =  utils.consoleAppUtil.getSubscribedCartridges();
+
+var errorInSession = session.get("errorinbackend");
+if(errorInSession != undefined) {
+   session.remove("errorinbackend");
+   error.push(errorInSession);
+}
+
 if(subscribedCartridges.Error != undefined){
     error.push(subscribedCartridges.Error);
 }