*) Suppress stacktrace on crawler error for "Unknown Host"

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

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@590 6c8d7289-2bf4-0310-a012-ef5d649a1542
This commit is contained in:
theli 2005-08-28 05:08:26 +00:00
parent e338a13de3
commit cb1f11c96b

View File

@ -46,6 +46,7 @@ import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
import java.net.SocketException; import java.net.SocketException;
import java.net.URL; import java.net.URL;
import java.net.UnknownHostException;
import java.util.Date; import java.util.Date;
import java.util.logging.FileHandler; import java.util.logging.FileHandler;
import java.util.logging.Level; import java.util.logging.Level;
@ -429,7 +430,10 @@ public final class plasmaCrawlWorker extends Thread {
boolean retryCrawling = false; boolean retryCrawling = false;
String errorMsg = e.getMessage(); String errorMsg = e.getMessage();
if (errorMsg != null) { if (errorMsg != null) {
if (e instanceof java.net.BindException) { if ((e instanceof UnknownHostException) || (errorMsg.indexOf("unknown host") >= 0)) {
log.logWarning("CRAWLER Unknown host in URL '" + url.toString() + "'. " +
"Referer URL: " + ((referer == null) ?"Unknown":referer));
} 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;
@ -450,7 +454,7 @@ public final class plasmaCrawlWorker extends Thread {
"'. Retrying request."); "'. Retrying request.");
retryCrawling = true; retryCrawling = true;
} else if (errorMsg.indexOf("Connection refused") >= 0) { } else if (errorMsg.indexOf("Connection refused") >= 0) {
log.logError("CRAWLER LOADER ERROR2 with URL=" + url.toString() + ": Connection refused"); log.logWarning("CRAWLER Connection refused while trying to connect to '" + url.toString() + "'.");
} }