public static DcaeConfigurations getDcaeConfigurations(String hostname)
throws CorrelationException {
String serviceAddrInfo = MicroServiceConfig.getServiceAddrInfoFromCBS(hostname);
- String response = getDcaeResponse(serviceAddrInfo);
+ String response;
+ try {
+ response = getDcaeResponse(serviceAddrInfo);
+ } catch (Exception e) {
+ throw new CorrelationException("Failed to connect to dcae", e);
+ }
DcaeConfigurations dcaeConfigurations = null;
dcaeConfigurations = DcaeConfigurationParser.parse(response);
return dcaeConfigurations;
e);\r
}\r
WebTarget webTarget = client.target(url);\r
- Response response = webTarget.request(MediaType.APPLICATION_JSON)\r
- .post(Entity.entity(content, MediaType.APPLICATION_JSON));\r
+ Response response = null;\r
+ try {\r
+ response = webTarget.request(MediaType.APPLICATION_JSON)\r
+ .post(Entity.entity(content, MediaType.APPLICATION_JSON));\r
+ } catch (Exception e) {\r
+ throw new CorrelationException("Failed to connect dcae.", e);\r
+ }\r
return checkStatus(response);\r
}\r
\r