sonar critical throw a dedicated exception 49/29449/1
authorSnigdha Sucharita Patra <sp00503415@techmahindra.com>
Mon, 29 Jan 2018 06:16:37 +0000 (11:46 +0530)
committerSnigdha Sucharita Patra <sp00503415@techmahindra.com>
Mon, 29 Jan 2018 06:18:07 +0000 (11:48 +0530)
Define and throw a dedicated exception instead of using a generic one
Sonar Link:
https://sonar.onap.org/component_issues?id=org.onap.dcaegen2.platform%3Ainventory-api#resolved=false|severities=CRITICAL|assignees=Snigdha503415
Location:
src/main/java/org/onap/dcae/inventory/daos/InventoryDAOManager.java
Line No-134

Change-Id: I94f4d39fd55dc11c1459971074944fc2ff589cae
Issue-ID: DCAEGEN2-214
Signed-off-by: Snigdha Sucharita Patra <sp00503415@techmahindra.com>
src/main/java/org/onap/dcae/inventory/daos/InventoryDAOManager.java

index b5f0b04..717d8c9 100644 (file)
@@ -131,7 +131,7 @@ public final class InventoryDAOManager {
                 LOG.info(String.format("Sql view created: %s", viewName));
             }
         } catch (Exception e) {
-            throw new RuntimeException("", e);
+            throw new InventoryDAOManagerSetupException("view does not exist, " + e);
         }
 
         // Do this assignment at the end after performing table checks to ensure that connection is good