*) Bugfix for suppressing of stacktrace in log on crawler error "MalformedURLException"

See: http://www.yacy-forum.de/viewtopic.php?p=8840

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@623 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
theli 20 years ago
parent 2ee4f9f4e5
commit 59b8a98c7e

@ -430,35 +430,36 @@ public final class plasmaCrawlWorker extends Thread {
} catch (Exception e) { } catch (Exception e) {
boolean retryCrawling = false; boolean retryCrawling = false;
String errorMsg = e.getMessage(); String errorMsg = e.getMessage();
if (errorMsg != null) {
if (e instanceof MalformedURLException) { if (e instanceof MalformedURLException) {
log.logWarning("CRAWLER Malformed URL '" + url.toString() + "' detected. "); log.logWarning("CRAWLER Malformed URL '" + url.toString() + "' detected. ");
} else if ((e instanceof UnknownHostException) || (errorMsg.indexOf("unknown host") >= 0)) { } else if ((e instanceof UnknownHostException) ||
((errorMsg != null) && (errorMsg.indexOf("unknown host") >= 0))) {
log.logWarning("CRAWLER Unknown host in URL '" + url.toString() + "'. " + log.logWarning("CRAWLER Unknown host in URL '" + url.toString() + "'. " +
"Referer URL: " + ((referer == null) ?"Unknown":referer)); "Referer URL: " + ((referer == null) ?"Unknown":referer));
} else if (e instanceof java.net.BindException) { } else if (e instanceof java.net.BindException) {
log.logWarning("CRAWLER BindException detected while trying to download content from '" + url.toString() + log.logWarning("CRAWLER BindException detected while trying to download content from '" + url.toString() +
"'. Retrying request."); "'. Retrying request.");
retryCrawling = true; retryCrawling = true;
} else if (errorMsg.indexOf("Corrupt GZIP trailer") >= 0) { } else if ((errorMsg != null) && (errorMsg.indexOf("Corrupt GZIP trailer") >= 0)) {
log.logWarning("CRAWLER Problems detected while receiving gzip encoded content from '" + url.toString() + log.logWarning("CRAWLER Problems detected while receiving gzip encoded content from '" + url.toString() +
"'. Retrying request without using gzip content encoding."); "'. Retrying request without using gzip content encoding.");
retryCrawling = true; retryCrawling = true;
} else if (errorMsg.indexOf("Read timed out") >= 0) { } else if ((errorMsg != null) && (errorMsg.indexOf("Read timed out") >= 0)) {
log.logWarning("CRAWLER Read timeout while receiving content from '" + url.toString() + log.logWarning("CRAWLER Read timeout while receiving content from '" + url.toString() +
"'. Retrying request."); "'. Retrying request.");
retryCrawling = true; retryCrawling = true;
} else if (errorMsg.indexOf("connect timed out") >= 0) { } else if ((errorMsg != null) && (errorMsg.indexOf("connect timed out") >= 0)) {
log.logWarning("CRAWLER Timeout while trying to connect to '" + url.toString() + log.logWarning("CRAWLER Timeout while trying to connect to '" + url.toString() +
"'. Retrying request."); "'. Retrying request.");
retryCrawling = true; retryCrawling = true;
} else if (errorMsg.indexOf("Connection timed out") >= 0) { } else if ((errorMsg != null) && (errorMsg.indexOf("Connection timed out") >= 0)) {
log.logWarning("CRAWLER Connection timeout while receiving content from '" + url.toString() + log.logWarning("CRAWLER Connection timeout while receiving content from '" + url.toString() +
"'. Retrying request."); "'. Retrying request.");
retryCrawling = true; retryCrawling = true;
} else if (errorMsg.indexOf("Connection refused") >= 0) { } else if ((errorMsg != null) && (errorMsg.indexOf("Connection refused") >= 0)) {
log.logWarning("CRAWLER Connection refused while trying to connect to '" + url.toString() + "'."); log.logWarning("CRAWLER Connection refused while trying to connect to '" + url.toString() + "'.");
} else if (errorMsg.indexOf("There is not enough space on the disk") >= 0) { } else if ((errorMsg != null) && (errorMsg.indexOf("There is not enough space on the disk") >= 0)) {
log.logSevere("CRAWLER Not enough space on the disk detected while crawling '" + url.toString() + "'. " + log.logSevere("CRAWLER Not enough space on the disk detected while crawling '" + url.toString() + "'. " +
"Pausing crawlers. "); "Pausing crawlers. ");
plasmaCrawlLoader.switchboard.pauseCrawling(); plasmaCrawlLoader.switchboard.pauseCrawling();
@ -498,11 +499,6 @@ public final class plasmaCrawlWorker extends Thread {
false false
); );
} }
} else {
// this may happen if the targeted host does not exist or anything with the
// remote server was wrong.
log.logSevere("CRAWLER LOADER ERROR2 with URL=" + url.toString() + ": " + e.toString(),e);
}
} finally { } finally {
if (remote != null) httpc.returnInstance(remote); if (remote != null) httpc.returnInstance(remote);
} }

Loading…
Cancel
Save