Log missing preloaded policy and continue 44/108644/1
authorChris Ramstad <cramstad@ciena.com>
Mon, 1 Jun 2020 21:35:32 +0000 (14:35 -0700)
committerChris Ramstad <cramstad@ciena.com>
Mon, 1 Jun 2020 21:35:32 +0000 (14:35 -0700)
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

main/src/main/java/org/onap/policy/api/main/startstop/ApiDatabaseInitializer.java

index cbd89cb..4cbfd06 100644 (file)
@@ -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
+}