/** * Throw an exception if the status code does not indicate success. * * @param response * The response. * * @return The response. * * @throws IOException */ private static JettyResponseListener checkResponseCode(final String url, final JettyResponseListener response) throws IOException { final int rc = response.getStatus(); if (rc < 200 || rc >= 300) { throw new HttpException(rc, "StatusCode=" + rc + ", StatusLine=" + response.getReason() + ", headers=" + response.getHeaders().toString() + ", ResponseBody=" + response.getResponseBody()); } if (log.isDebugEnabled()) { /* * write out the status list, headers, etc. */ log.debug("*** Response ***"); log.debug("Status Line: " + response.getReason()); } return response; }
/** * Throw an exception if the status code does not indicate success. * * @param response * The response. * * @return The response. * * @throws IOException */ private static JettyResponseListener checkResponseCode(final String url, final JettyResponseListener response) throws IOException { final int rc = response.getStatus(); if (rc < 200 || rc >= 300) { throw new HttpException(rc, "StatusCode=" + rc + ", StatusLine=" + response.getReason() + ", headers=" + response.getHeaders().toString() + ", ResponseBody=" + response.getResponseBody()); } if (log.isDebugEnabled()) { /* * write out the status list, headers, etc. */ log.debug("*** Response ***"); log.debug("Status Line: " + response.getReason()); } return response; }
default: throw new HttpException(listener.getStatus(), "status=" + listener.getStatus() + ", reason" + listener.getReason());
default: throw new HttpException(listener.getStatus(), "status=" + listener.getStatus() + ", reason" + listener.getReason());
default: throw new HttpException(listener.getStatus(), "status=" + listener.getStatus() + ", reason" + listener.getReason());
default: throw new HttpException(listener.getStatus(), "status=" + listener.getStatus() + ", reason" + listener.getReason());