Pass catched exception to the throwing exception
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/b2cd07dc Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/b2cd07dc Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/b2cd07dc Branch: refs/heads/master Commit: b2cd07dcf1a652d3f9cf62509f8866c933d6ca82 Parents: b0c49f0 Author: Lahiru Sandaruwan <[email protected]> Authored: Sat Apr 25 08:49:34 2015 +0530 Committer: Lahiru Sandaruwan <[email protected]> Committed: Sat Apr 25 08:49:34 2015 +0530 ---------------------------------------------------------------------- .../autoscaler/services/impl/AutoscalerServiceImpl.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/stratos/blob/b2cd07dc/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java index a3f9cb3..b484d2c 100644 --- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java +++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java @@ -978,11 +978,13 @@ public class AutoscalerServiceImpl implements AutoscalerService { = clusterMonitor.getClusterContext().getNetworkPartitionCtxt(networkPartition.getId()); try { + addNewPartitionsToClusterMonitor(clusterLevelNetworkPartitionContext, networkPartition, deploymentPolicy.getDeploymentPolicyID(), clusterMonitor.getClusterContext().getServiceId()); } catch (RemoteException e) { - String message = "Cluster monitor update failed for [deployment-policy] " - + deploymentPolicy.getDeploymentPolicyID(); + + String message = "Connection to cloud controller failed, Cluster monitor update failed for" + + " [deployment-policy] " + deploymentPolicy.getDeploymentPolicyID(); log.error(message); throw new CloudControllerConnectionException(message, e); } catch (CloudControllerServiceInvalidPartitionExceptionException e) { @@ -996,7 +998,7 @@ public class AutoscalerServiceImpl implements AutoscalerService { String message = "Cluster monitor update failed for [deployment-policy] " + deploymentPolicy.getDeploymentPolicyID() + " [cluster] " + clusterMonitor.getClusterId(); log.error(message); - throw new InvalidDeploymentPolicyException(message); + throw new InvalidDeploymentPolicyException(message, e); } removeOldPartitionsFromClusterMonitor(clusterLevelNetworkPartitionContext, networkPartition); }
