You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by im...@apache.org on 2015/05/17 20:37:21 UTC

stratos git commit: Updating add network partition API method to return the actual error message to the client

Repository: stratos
Updated Branches:
  refs/heads/master a42581036 -> 7503728f0


Updating add network partition API method to return the actual error message to the client


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

Branch: refs/heads/master
Commit: 7503728f0ace9065866c29168731218fbdd4a0c7
Parents: a425810
Author: Imesh Gunaratne <im...@apache.org>
Authored: Mon May 18 00:07:09 2015 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Mon May 18 00:07:09 2015 +0530

----------------------------------------------------------------------
 .../controller/services/impl/CloudControllerServiceImpl.java      | 3 ++-
 .../org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java  | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/7503728f/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/CloudControllerServiceImpl.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/CloudControllerServiceImpl.java b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/CloudControllerServiceImpl.java
index 3e7544f..542641b 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/CloudControllerServiceImpl.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/CloudControllerServiceImpl.java
@@ -1449,7 +1449,8 @@ public class CloudControllerServiceImpl implements CloudControllerService {
                         networkPartition.getId()));
             }
         } catch (Exception e) {
-            String message = "Could not add network partition";
+            // Use the actual error message when throwing the exception to the client
+            String message = e.getMessage();
             log.error(message);
             throw new CloudControllerException(message, e);
         }

http://git-wip-us.apache.org/repos/asf/stratos/blob/7503728f/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java
index 4a88db6..dde1f32 100644
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java
+++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java
@@ -2604,7 +2604,8 @@ public class StratosApiV41Utils {
             serviceClient.addNetworkPartition(
                     ObjectConverter.convertNetworkPartitionToCCStubNetworkPartition(networkPartitionBean));
         } catch (RemoteException e) {
-            String message = "Could not add network partition";
+            // Use the actual error message when returning the error to the client
+            String message = e.getMessage();
             log.error(message);
             throw new RestAPIException(message, e);
         }