From: Snigdha Sucharita Patra Date: Mon, 29 Jan 2018 09:03:42 +0000 (+0530) Subject: sonar critical throw a dedicated exception X-Git-Tag: 2.0.0-ONAP~51 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=2342bb1b5e101354319a30d62bb02bfde0d3805d;p=dcaegen2%2Fplatform%2Finventory-api.git sonar critical throw a dedicated exception 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-143 Change-Id: I52ecbd360bff6efa8906623ae7345ef694491d6b Issue-ID: DCAEGEN2-215 Signed-off-by: Snigdha Sucharita Patra --- diff --git a/src/main/java/org/onap/dcae/inventory/daos/InventoryDAOManager.java b/src/main/java/org/onap/dcae/inventory/daos/InventoryDAOManager.java index 717d8c9..c2527e2 100644 --- a/src/main/java/org/onap/dcae/inventory/daos/InventoryDAOManager.java +++ b/src/main/java/org/onap/dcae/inventory/daos/InventoryDAOManager.java @@ -140,7 +140,7 @@ public final class InventoryDAOManager { private InventoryDAO getDAO(Class klass) { if (jdbi == null) { - throw new RuntimeException("InventoryDAOManager has not been initialized!"); + throw new InventoryDAOManagerSetupException("InventoryDAOManager has not been initialized!"); } // Using this approach to constructing the DAO, the client is not responsible for closing the handle.