Skip to content

Commit

Permalink
add another try catch
Browse files Browse the repository at this point in the history
  • Loading branch information
Long Pham committed May 24, 2018
1 parent 1ec4367 commit 8e4390f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 22 deletions.
35 changes: 16 additions & 19 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 8e4390f

Please sign in to comment.