if (statusCode != HttpStatus.SC_OK) {
String message = "URL access returned " + HttpStatus.getStatusText(statusCode);
log.error(message);
if (attempt > maxTry) {
log.warn("Error. Maximum attempts count reached.");
throw new APIException(message);
}
try {
Thread.sleep(30000);
} catch (InterruptedException e) {
// Nothing
}
} else {
return root;
}
} catch (JDOMException e) {
String message = "JDOMException: " + e.getMessage();
log.error(message);
if (attempt > maxTry) {
log.warn("Error. Maximum attempts count reached.");
throw new APIException("Error parsing XML result", e);
}
try {
Thread.sleep(30000);
} catch (InterruptedException e2) {
// Nothing
}
} catch (IOException e) {
String message = "IOException: " + e.getMessage();
log.error(message);
if (attempt > maxTry) {
log.warn("Error. Maximum attempts count reached.");
throw new APIException("Error accessing MediaWiki", e);
}
try {
Thread.sleep(30000);
} catch (InterruptedException e2) {
// Nothing