private void handleException(Exception ex, String msg, boolean resourceNotFoundExpected) { final ClientResponse.Status status = ex instanceof UniformInterfaceException ? ((UniformInterfaceException)ex).getResponse().getClientResponseStatus() : null; if (status == NOT_FOUND && resourceNotFoundExpected || status == CONFLICT) { logger.debug(msg, ex); } else if (returnNoneOnExceptions) { if (status != null && status.getFamily() == Response.Status.Family.CLIENT_ERROR) { logger.info(msg, ex); } else { logger.error(msg, ex); } } else { throw ex instanceof RuntimeException ? (RuntimeException)ex : new RuntimeException(msg, ex); } }
private void handleException(Exception ex, String msg, boolean resourceNotFoundExpected) { final ClientResponse.Status status = ex instanceof UniformInterfaceException ? ((UniformInterfaceException)ex).getResponse().getClientResponseStatus() : null; if (status == NOT_FOUND && resourceNotFoundExpected || status == CONFLICT) { logger.debug(msg, ex); } else if (returnNoneOnExceptions) { if (status != null && status.getFamily() == Response.Status.Family.CLIENT_ERROR) { logger.info(msg, ex); } else { logger.error(msg, ex); } } else { throw ex instanceof RuntimeException ? (RuntimeException)ex : new RuntimeException(msg, ex); } }
if (status.getFamily() == javax.ws.rs.core.Response.Status.Family.SUCCESSFUL) { message += " [status: " + status.getFamily() + " reason: " + status.getReasonPhrase() + "]"; log.warning(message); } else { message += " [status: " + status.getFamily() + " reason: " + status.getReasonPhrase() + "]"; log.severe(message); throw new ContainerException(message);
} else if (response.getClientResponseStatus().getFamily() == Family.SUCCESSFUL) {
} else if (response.getClientResponseStatus().getFamily() == Family.SUCCESSFUL) {
} else if (response.getClientResponseStatus().getFamily() == Family.SUCCESSFUL) {
} else if (response.getClientResponseStatus().getFamily() == Family.SUCCESSFUL) {
} else if (response.getClientResponseStatus().getFamily() == Family.SUCCESSFUL) {
@Override public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { WebResource resource = getResource(listener); if (resource != null) { try { ClientResponse response = resource.post(ClientResponse.class); if (Response.Status.Family.SUCCESSFUL.equals(response.getClientResponseStatus().getFamily())) { listener.getLogger().printf("Successfully triggered JIRA to update builds of this job\n"); } else { listener.error("Unable to trigger JIRA to update builds of this job, JIRA responded with [%d] %s", response.getClientResponseStatus().getStatusCode(), response.getClientResponseStatus().getReasonPhrase()); } } catch (Exception e) { listener.error("Failed to triggered JIRA to update builds of this job -> %s", e.getMessage()); } } return true; }
@Override public boolean isSuccess() { return Response.Status.Family.SUCCESSFUL.equals(delegate.getClientResponseStatus().getFamily()); }
protected void checkResponse(final ClientResponse response) { final Family family = response.getClientResponseStatus().getFamily(); if(family != Family.SUCCESSFUL) { final ResponseException exception = buildResponseException(response); throw exception; } }
@Override public boolean isSuccess() { boolean isSuccess = false; ClientResponse.Status s = bcr != null? bcr.getClientResponseStatus(): null; isSuccess = s!=null? (s.getFamily() == javax.ws.rs.core.Response.Status.Family.SUCCESSFUL): false; return isSuccess; }
public boolean isSuccessfullFamily() { return baseResponse.getClientResponseStatus().getFamily() == Response.Status.Family.SUCCESSFUL; }
@Override public boolean isSuccess() { return Response.Status.Family.SUCCESSFUL.equals(delegate.getClientResponseStatus().getFamily()); }