summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLott, Christopher (cl778h) <cl778h@att.com>2020-04-23 15:57:53 -0400
committerLott, Christopher (cl778h) <cl778h@att.com>2020-04-23 16:04:37 -0400
commit8c193243356e909d0210036006aa9416c6455d00 (patch)
treecf15d12ef224a5c12a06f78779d713ba68a62173
parentd9c58a74a9a791101e45ea01ee46feb827d2fa16 (diff)
Report, not discard, caught exception in ctor
The PortalRestCentralServiceImpl constructor instantiates a class by name then calls methods on the new object. The ctor uses try/catch but if an exception occurs, the ctor discards that exception and throws ClassCastException with a vague message. Change to throw ServletException and include the cause exception. Change-Id: I4f9f0c03026cedff5e65fb904f24eb3f6b658fac Issue-ID: PORTAL-865 Signed-off-by: Lott, Christopher (cl778h) <cl778h@att.com>
-rw-r--r--ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/onboarding/crossapi/PortalRestAPICentralServiceImpl.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/onboarding/crossapi/PortalRestAPICentralServiceImpl.java b/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/onboarding/crossapi/PortalRestAPICentralServiceImpl.java
index 54ce2f4f..21c3f21c 100644
--- a/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/onboarding/crossapi/PortalRestAPICentralServiceImpl.java
+++ b/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/onboarding/crossapi/PortalRestAPICentralServiceImpl.java
@@ -85,7 +85,7 @@ public class PortalRestAPICentralServiceImpl implements IPortalRestAPIService {
password = portalRestCentralService.getAppCredentials().get(IPortalRestCentralService.CREDENTIALS_PASS);
appName = portalRestCentralService.getAppCredentials().get(IPortalRestCentralService.CREDENTIALS_APP);
} catch (Exception e) {
- throw new ClassCastException("Failed to find or instantiate class ");
+ throw new ServletException("Failed to instantiate class " + centralClassName, e);
}
}
@@ -211,4 +211,4 @@ public class PortalRestAPICentralServiceImpl implements IPortalRestAPIService {
return credentialsMap;
}
-} \ No newline at end of file
+}