@Override public RequestStatus apply(final HttpResponse input) { final int statusCode = input.getStatusCode(); if (statusCode >= 200 && statusCode < 400) { return RequestStatus.create(true, null); } else { throw new RuntimeException(input.getStatusLine()); } } }
public HttpResponseException(HttpCommand command, HttpResponse response, String content) { this(String.format("command: %s failed with response: %s; content: [%s]", command.getCurrentRequest() .getRequestLine(), response.getStatusLine(), content), command, response, content); }
public HttpResponseException(HttpCommand command, HttpResponse response, Throwable cause) { this(String.format("command: %1$s failed with response: %2$s", command.getCurrentRequest().getRequestLine(), response.getStatusLine()), command, response, cause); }
public HttpResponseException(HttpCommand command, HttpResponse response, String content) { this(String.format("command: %s failed with response: %s; content: [%s]", command.getCurrentRequest() .getRequestLine(), response.getStatusLine(), content), command, response, content); }
public HttpResponseException(HttpCommand command, HttpResponse response, String content, Throwable cause) { this(String.format("command: %1$s failed with response: %2$s; content: [%3$s]", command.getCurrentRequest() .getRequestLine(), response.getStatusLine(), content), command, response, content, cause); }
public HttpResponseException(HttpCommand command, HttpResponse response, Throwable cause) { this(String.format("command: %1$s failed with response: %2$s", command.getCurrentRequest().getRequestLine(), response.getStatusLine()), command, response, cause); }
public HttpResponseException(HttpCommand command, HttpResponse response, String content) { this(String.format("command: %s failed with response: %s; content: [%s]", command.getCurrentRequest() .getRequestLine(), response.getStatusLine(), content), command, response, content); }
public HttpResponseException(HttpCommand command, HttpResponse response, String content) { this(String.format("command: %s failed with response: %s; content: [%s]", command.getCurrentRequest() .getRequestLine(), response.getStatusLine(), content), command, response, content); }
public HttpResponseException(HttpCommand command, HttpResponse response, String content, Throwable cause) { this(String.format("command: %1$s failed with response: %2$s; content: [%3$s]", command.getCurrentRequest() .getRequestLine(), response.getStatusLine(), content), command, response, content, cause); }
public DigitalOcean2RateLimitExceededException(HttpResponse response) { super(response.getStatusLine() + "\n" + rateLimitHeaders(response)); parseRateLimitInfo(response); }
public void logResponse(Logger logger, HttpResponse response, String prefix) { if (logger.isDebugEnabled()) { logger.debug("%s %s", prefix, response.getStatusLine().toString()); logMessage(logger, response, prefix); } }
public void logResponse(Logger logger, HttpResponse response, String prefix) { if (logger.isDebugEnabled()) { logger.debug("%s %s", prefix, response.getStatusLine().toString()); logMessage(logger, response, prefix); } }
public void logResponse(Logger logger, HttpResponse response, String prefix) { if (logger.isDebugEnabled()) { logger.debug("%s %s", prefix, response.getStatusLine().toString()); logMessage(logger, response, prefix); } }
public void logResponse(Logger logger, HttpResponse response, String prefix) { if (logger.isDebugEnabled()) { logger.debug("%s %s", prefix, response.getStatusLine().toString()); logMessage(logger, response, prefix); } }
public void logResponse(Logger logger, HttpResponse response, String prefix) { if (logger.isDebugEnabled()) { logger.debug("%s %s", prefix, response.getStatusLine().toString()); logMessage(logger, response, prefix); } }
public HttpResponseException(HttpCommand command, HttpResponse response) { this(String.format("request: %s %sfailed with response: %s", command.getCurrentRequest().getRequestLine(), requestPayloadIfStringOrFormIfNotReturnEmptyString(command.getCurrentRequest()), response.getStatusLine()), command, response); }
public HttpResponseException(HttpCommand command, HttpResponse response) { this(String.format("request: %s %sfailed with response: %s", command.getCurrentRequest().getRequestLine(), requestPayloadIfStringOrFormIfNotReturnEmptyString(command.getCurrentRequest()), response.getStatusLine()), command, response); }
public HttpResponseException(HttpCommand command, HttpResponse response, boolean logSensitiveInformation) { this(String.format("request: %s %sfailed with response: %s", command.getCurrentRequest().getRequestLine(), requestPayloadIfStringOrFormIfNotReturnEmptyString(command.getCurrentRequest(), logSensitiveInformation), response.getStatusLine()), command, response); }
public HttpResponseException(HttpCommand command, HttpResponse response) { this(String.format("request: %s %sfailed with response: %s", command.getCurrentRequest().getRequestLine(), requestPayloadIfStringOrFormIfNotReturnEmptyString(command.getCurrentRequest()), response.getStatusLine()), command, response); }
public HttpResponseException(HttpCommand command, HttpResponse response, boolean logSensitiveInformation) { this(String.format("request: %s %sfailed with response: %s", command.getCurrentRequest().getRequestLine(), requestPayloadIfStringOrFormIfNotReturnEmptyString(command.getCurrentRequest(), logSensitiveInformation), response.getStatusLine()), command, response); }