fix exception throw after sendError in DefaultServlet

- reduce debug exception logs in crawler
pull/14/head
reger 10 years ago
parent 348b8db9d2
commit 367fe388b9

@ -674,7 +674,6 @@ public class CrawlQueues {
if (CrawlQueues.log.isFine()) {
CrawlQueues.log.fine("problem loading " + request.url().toString() + ": " + e.getMessage());
}
e.printStackTrace();
error = "load error - " + e.getMessage();
}
@ -693,7 +692,6 @@ public class CrawlQueues {
}
} catch (final Exception e) {
CrawlQueues.this.errorURL.push(request.url(), request.depth(), profile, FailCategory.TEMPORARY_NETWORK_FAILURE, e.getMessage() + " - in worker", -1);
ConcurrentLog.logException(e);
request.setStatus("worker-exception", WorkflowJob.STATUS_FINISHED);
} finally {
request = null;

@ -460,6 +460,7 @@ public class YaCyDefaultServlet extends HttpServlet {
} catch (IllegalArgumentException iae) {
if (!response.isCommitted()) {
response.sendError(HttpServletResponse.SC_BAD_REQUEST, iae.getMessage());
return false;
}
throw iae;
}
@ -1075,9 +1076,9 @@ public class YaCyDefaultServlet extends HttpServlet {
filecontent = item.getInputStream();
files.put(new AbstractMap.SimpleEntry<String, byte[]>(item.getFieldName(), FileUtils.read(filecontent)));
} catch (IOException e) {
ConcurrentLog.logException(e);
ConcurrentLog.info("FILEHANDLER", e.getMessage());
} finally {
if (filecontent != null) try {filecontent.close();} catch (IOException e) {ConcurrentLog.logException(e);}
if (filecontent != null) try {filecontent.close();} catch (IOException e) {ConcurrentLog.info("FILEHANDLER", e.getMessage());}
}
}
}
@ -1108,7 +1109,7 @@ public class YaCyDefaultServlet extends HttpServlet {
for (int j = 0; j < t; j++) p[j].join();
}
} catch (Exception ex) {
ConcurrentLog.logException(ex);
ConcurrentLog.info("FILEHANDLER", ex.getMessage());
}
}

Loading…
Cancel
Save