From 8e4390f20fb400a0a39853877c8fbea48b22ee25 Mon Sep 17 00:00:00 2001 From: Long Pham Date: Thu, 24 May 2018 13:40:09 -0500 Subject: [PATCH] add another try catch --- .idea/workspace.xml | 35 +++++++++---------- .../HTMLDocumentIngestionManager.java | 14 ++++++-- 2 files changed, 27 insertions(+), 22 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 2befe4a..ad17103 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,10 +2,7 @@ - - - @@ -32,11 +29,11 @@ - + - - + + @@ -103,11 +100,11 @@ - + - - + + @@ -226,8 +223,8 @@ @@ -429,8 +426,8 @@ - + @@ -455,12 +452,12 @@ - + - @@ -932,20 +929,20 @@ - + - - + + - + - - + + diff --git a/src/main/java/org/forward/entitysearch/ingestion/HTMLDocumentIngestionManager.java b/src/main/java/org/forward/entitysearch/ingestion/HTMLDocumentIngestionManager.java index ff95660..06f7f48 100644 --- a/src/main/java/org/forward/entitysearch/ingestion/HTMLDocumentIngestionManager.java +++ b/src/main/java/org/forward/entitysearch/ingestion/HTMLDocumentIngestionManager.java @@ -311,7 +311,15 @@ public static void main(String[] args) { System.out.println(filename + "\t" + baseUrl); - ESAnnotatedHTMLDocument document = getHTMLDocumentForAnnotation(baseUrl, driver); + ESAnnotatedHTMLDocument document = null; + try { + document = getHTMLDocumentForAnnotation(baseUrl, driver); + } catch(Exception ex) { + System.out.println("There is some exception when parsing the document "); + System.err.println("There is some exception when parsing the document in this URL: " + baseUrl); + System.err.println(ex.getClass()); + continue; + } time = System.currentTimeMillis(); System.out.println("Finish creating document for annotation " + (time-start)/1000 + " seconds"); start = time; @@ -339,8 +347,8 @@ public static void main(String[] args) { try { AnnotatorFactory.getInstance().getAnnotationPipeline().annotate(document); } catch(StaleElementReferenceException ex) { - System.out.println("Some dangling nodes are found in this URL"); - System.err.println("Some dangling nodes are found in this URL: " + baseUrl); + System.out.println("There is an exception when annotating this document"); + System.err.println("There is an exception when the document in this URL: " + baseUrl); continue; }