X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=holmes-actions%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fholmes%2Fcommon%2Fdmaap%2FPublisher.java;h=0f96181c6e3f56a143f799df18888c648682ceaf;hb=6c9ff5b3edcb451bb61ff2180e30f79339434d1f;hp=285c3d6fcbe597754bee9a6165dd298bf2d3283b;hpb=cea973bd4b6c2e13db5600ac2504b2abab596a21;p=holmes%2Fcommon.git diff --git a/holmes-actions/src/main/java/org/onap/holmes/common/dmaap/Publisher.java b/holmes-actions/src/main/java/org/onap/holmes/common/dmaap/Publisher.java index 285c3d6..0f96181 100644 --- a/holmes-actions/src/main/java/org/onap/holmes/common/dmaap/Publisher.java +++ b/holmes-actions/src/main/java/org/onap/holmes/common/dmaap/Publisher.java @@ -52,8 +52,13 @@ public class Publisher { e); } WebTarget webTarget = client.target(url); - Response response = webTarget.request(MediaType.APPLICATION_JSON) - .post(Entity.entity(content, MediaType.APPLICATION_JSON)); + Response response = null; + try { + response = webTarget.request(MediaType.APPLICATION_JSON) + .post(Entity.entity(content, MediaType.APPLICATION_JSON)); + } catch (Exception e) { + throw new CorrelationException("Failed to connect dcae.", e); + } return checkStatus(response); }