StatusLine statusLine = response.getStatusLine();
if (statusLine.getStatusCode() != 200) {
log.info("Error reading from metrics service: " + statusLine);
throw new RestClientException("Error reading from metrics service", null, statusLine.getStatusCode());
} else {
MetricServiceData ret = new MetricServiceData(request, response);
response = null; // Don't close yet
return ret;
}
} catch (IOException e) {
throw new RestClientException("Error reading from metrics service", e);
} finally {
if (response != null) {
try {
EntityUtils.consume(response.getEntity());
} catch (IOException e) {