diff options
Diffstat (limited to 'src/main/java/org/onap/dcae')
-rw-r--r-- | src/main/java/org/onap/dcae/inventory/daos/InventoryDAOManager.java | 4 | ||||
-rw-r--r-- | src/main/java/org/onap/dcae/inventory/exceptions/mappers/DBIExceptionMapper.java | 2 |
2 files changed, 3 insertions, 3 deletions
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..c2527e2 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 @@ -140,7 +140,7 @@ public final class InventoryDAOManager { private InventoryDAO getDAO(Class<? extends InventoryDAO> 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. diff --git a/src/main/java/org/onap/dcae/inventory/exceptions/mappers/DBIExceptionMapper.java b/src/main/java/org/onap/dcae/inventory/exceptions/mappers/DBIExceptionMapper.java index 016ac27..cd348c1 100644 --- a/src/main/java/org/onap/dcae/inventory/exceptions/mappers/DBIExceptionMapper.java +++ b/src/main/java/org/onap/dcae/inventory/exceptions/mappers/DBIExceptionMapper.java @@ -60,7 +60,7 @@ public class DBIExceptionMapper<T extends DBIException> implements ExceptionMapp InventoryDAOManager.getInstance().initialize(); clientMessage.append(" Connection has been successfully reset. Please try again."); } catch(Exception e) { - LOG.error(String.format("Failed to re-initialize database connection: %s", e.getMessage())); + LOG.error(String.format("Failed to re-initialize database connection: %s", e)); clientMessage.append(" Connection reset attempt has failed. Please try again soon."); } |