}
}
}
if (responseCode != OK) {
if (responseCode < INTERNAL_SERVER_ERROR || retriedCount == retryCount) {
throw new WeiboException(getCause(responseCode) + "\n" + res.asString(), responseCode);
}
// will retry if the status code is INTERNAL_SERVER_ERROR
} else {
break;
}
} finally {
try {
osw.close();
} catch (Exception ignore) {
}
}
} catch (IOException ioe) {
// connection timeout or read timeout
if (retriedCount == retryCount) {
throw new WeiboException(ioe.getMessage(), ioe, responseCode);
}
}
try {
if(DEBUG && null != res){
res.asString();