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>
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);
}
}
return credentialsMap;
}
-}
\ No newline at end of file
+}