From: Snigdha Sucharita Patra Date: Mon, 29 Jan 2018 06:16:37 +0000 (+0530) Subject: sonar critical throw a dedicated exception X-Git-Tag: 2.0.0-ONAP~52 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=e409bcd51428cacfee12beb46901893158bb0a75;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-134 Change-Id: I94f4d39fd55dc11c1459971074944fc2ff589cae Issue-ID: DCAEGEN2-214 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 b5f0b04..717d8c9 100644 --- a/src/main/java/org/onap/dcae/inventory/daos/InventoryDAOManager.java +++ b/src/main/java/org/onap/dcae/inventory/daos/InventoryDAOManager.java @@ -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