Imporved error message.

This commit is contained in:
Christian P. MOMON 2022-01-20 16:27:25 +01:00
parent eee023346f
commit 00d778c9f3

View file

@ -117,28 +117,24 @@ public class Crawler
logger.error("ERROR: crawl failed for [{}]: {}", url.toString(), exception.getMessage()); logger.error("ERROR: crawl failed for [{}]: {}", url.toString(), exception.getMessage());
this.journal.add(url, parentURL, CrawlStatus.CONNECTERROR); this.journal.add(url, parentURL, CrawlStatus.CONNECTERROR);
downloadFile = null; downloadFile = null;
exception.printStackTrace();
} }
catch (java.net.SocketException exception) catch (java.net.SocketException exception)
{ {
logger.error("ERROR: crawl failed for [{}]: {}", url.toString(), exception.getMessage()); logger.error("ERROR: crawl failed for [{}]: {}", url.toString(), exception.getMessage());
this.journal.add(url, parentURL, CrawlStatus.CONNECTERROR); this.journal.add(url, parentURL, CrawlStatus.CONNECTERROR);
downloadFile = null; downloadFile = null;
exception.printStackTrace();
} }
catch (FileNotFoundException exception) catch (FileNotFoundException exception)
{ {
logger.error("ERROR: crawl failed for [{}]: {}", url.toString(), exception.getMessage()); logger.error("ERROR: crawl failed for [{}]: {}", url.toString(), exception.getMessage());
this.journal.add(url, parentURL, CrawlStatus.URLNOTFOUND); this.journal.add(url, parentURL, CrawlStatus.URLNOTFOUND);
downloadFile = null; downloadFile = null;
exception.printStackTrace();
} }
catch (IOException exception) catch (IOException exception)
{ {
logger.error("ERROR: crawl failed for [{}]: {}", url.toString(), exception.getMessage()); logger.error("ERROR: crawl failed for [{}]: {}", url.toString(), exception.getMessage());
this.journal.add(url, parentURL, CrawlStatus.DOWNLOADERROR); this.journal.add(url, parentURL, CrawlStatus.DOWNLOADERROR);
downloadFile = null; downloadFile = null;
exception.printStackTrace();
} }
if (downloadFile != null) if (downloadFile != null)