if (responseCode < OK || (responseCode != FOUND && MULTIPLE_CHOICES <= responseCode)) {
if (responseCode == ENHANCE_YOUR_CLAIM ||
responseCode == BAD_REQUEST ||
responseCode < INTERNAL_SERVER_ERROR ||
retriedCount == CONF.getHttpRetryCount()) {
throw new TwitterException(res.asString(), res);
}
// will retry if the status code is INTERNAL_SERVER_ERROR
} else {
break;
}
} finally {
try {
os.close();
} catch (Exception ignore) {
}
}
} catch (IOException ioe) {
// connection timeout or read timeout
if (retriedCount == CONF.getHttpRetryCount()) {
throw new TwitterException(ioe.getMessage(), ioe, responseCode);
}
}
try {
if (logger.isDebugEnabled() && res != null) {
res.asString();