aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorDeterme, Sebastien (sd378r) <sd378r@intl.att.com>2017-10-06 14:11:34 +0200
committerDeterme, Sebastien (sd378r) <sd378r@intl.att.com>2017-10-06 14:11:34 +0200
commitaccde3272e9f9f0fc22588dc203230cf21186277 (patch)
treede5cffa1fa902d01a7851250befa363aed91c653 /src/main/java
parent8fec5251206b69b427f88a45e393add15a4963fc (diff)
Restoring try catch for policy request
This exception log was not useful so it has been removed and replaced by an easier log to understand Change-Id: Ie25426d3b8b44b55a3fd2dd3807620d98fad5bbf Issue-ID: CLAMP-54 Signed-off-by: Determe, Sebastien (sd378r) <sd378r@intl.att.com>
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/onap/clamp/clds/client/PolicyClient.java19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/main/java/org/onap/clamp/clds/client/PolicyClient.java b/src/main/java/org/onap/clamp/clds/client/PolicyClient.java
index d4f9014b..cb86acbd 100644
--- a/src/main/java/org/onap/clamp/clds/client/PolicyClient.java
+++ b/src/main/java/org/onap/clamp/clds/client/PolicyClient.java
@@ -365,15 +365,18 @@ public class PolicyClient {
logger.info("policyName=" + policyName);
configRequestParameters.setPolicyName(policyName);
-
- Collection<PolicyConfig> response = getPolicyEngine().getConfig(configRequestParameters);
- for (PolicyConfig policyConfig : response) {
- Integer version = Integer.valueOf(policyConfig.getPolicyVersion());
- versions.add(version);
+ try {
+ Collection<PolicyConfig> response = getPolicyEngine().getConfig(configRequestParameters);
+ for (PolicyConfig policyConfig : response) {
+ Integer version = Integer.valueOf(policyConfig.getPolicyVersion());
+ versions.add(version);
+ }
+ Collections.sort(versions);
+ logger.info("Policy versions.size()=" + versions.size());
+ } catch (PolicyConfigException e) {
+ // just print warning - if no policy version found
+ logger.warn("warning: policy not found...policy name - " + policyName, e.getMessage());
}
- Collections.sort(versions);
- logger.info("Policy versions.size()=" + versions.size());
-
return versions;
}