if (responseCode >= 200 && responseCode < 300) {
break;
} else {
if (responseCode < INTERNAL_SERVER_ERROR || retriedCount == retryCount) {
throw new FitbitAPIException(getCause(responseCode), res);
}
// will retry if the status code is INTERNAL_SERVER_ERROR
}
} finally {
try {
osw.close();
} catch (Exception ignore) {
}
}
} catch (IOException ioe) {
// connection timeout or read timeout
if (retriedCount == retryCount) {
throw new FitbitAPIException(ioe.getMessage(), ioe, responseCode);
}
}
try {
if (log.isDebugEnabled() && null!=res) {
res.asString();