HttpResponse response = client.execute(request);
if (null == response) {
LOGGER.severe("null response");
throw new TwitterClientException("null HTTP response");
} else {
//showResponseInfo(response);
int code = response.getStatusLine().getStatusCode();
if (200 == code) {
return response;
} else {
LOGGER.warning("unsuccessful request (response code " + code + ")");
// Attempt to consume the response body, so as to avoid "connection still allocated" errors on
// subsequent requests.
try {
response.getEntity().consumeContent();
} catch (IOException e) {
throw new TwitterClientException("failed to consume (error) response body", e);
}
// All of the below involve throwing an exception.
switch (code) {
case 304: