summaryrefslogtreecommitdiffstats
path: root/main/src
diff options
context:
space:
mode:
authorChris Ramstad <cramstad@ciena.com>2020-06-01 14:35:32 -0700
committerChris Ramstad <cramstad@ciena.com>2020-06-01 14:35:32 -0700
commit40a9b49d84a9ee91de709d5ee92ff2ff3a706a4e (patch)
treeab571b2f1a4808eec4d75143734f562d27ba8f35 /main/src
parent4a3b724db961506d6d949ddbf905f40e309ab3c0 (diff)
Log missing preloaded policy and continue
If a policy type can't be preloaded because it doesn't exist, log and continue. Issue-ID: POLICY-2487 Signed-off-by: Chris Ramstad <cramstad@ciena.com> Change-Id: I2a26e660d7337b2db153491a6bb3373b1470cbee
Diffstat (limited to 'main/src')
-rw-r--r--main/src/main/java/org/onap/policy/api/main/startstop/ApiDatabaseInitializer.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/main/src/main/java/org/onap/policy/api/main/startstop/ApiDatabaseInitializer.java b/main/src/main/java/org/onap/policy/api/main/startstop/ApiDatabaseInitializer.java
index cbd89cb8..4cbfd06d 100644
--- a/main/src/main/java/org/onap/policy/api/main/startstop/ApiDatabaseInitializer.java
+++ b/main/src/main/java/org/onap/policy/api/main/startstop/ApiDatabaseInitializer.java
@@ -114,7 +114,8 @@ public class ApiDatabaseInitializer {
for (String entity : entities) {
String entityAsStringYaml = ResourceUtils.getResourceAsString(entity);
if (entityAsStringYaml == null) {
- throw new PolicyApiException("Preloading entity cannot be found: " + entity);
+ LOGGER.warn("Preloading entity cannot be found: " + entity);
+ continue;
}
ToscaServiceTemplate singleEntity =
@@ -150,4 +151,4 @@ public class ApiDatabaseInitializer {
protected interface FunctionWithEx<T, R> {
public R apply(T value) throws PfModelException;
}
-} \ No newline at end of file
+}