Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(235)

Unified Diff: java/org/chromium/distiller/webdocument/DomConverter.java

Issue 2288143003: Ignore exceptions in embed extractors (Closed) Base URL: git@github.com:chromium/dom-distiller.git@noiframe
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | javatests/org/chromium/distiller/ContentExtractorTest.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: java/org/chromium/distiller/webdocument/DomConverter.java
diff --git a/java/org/chromium/distiller/webdocument/DomConverter.java b/java/org/chromium/distiller/webdocument/DomConverter.java
index 0ff2f8912a802b23ec64732f5e16969c3d0a6ac0..882c71e8967772e6abf1d60d83fe52248ab53ae0 100644
--- a/java/org/chromium/distiller/webdocument/DomConverter.java
+++ b/java/org/chromium/distiller/webdocument/DomConverter.java
@@ -87,16 +87,20 @@ public class DomConverter implements DomWalker.Visitor {
// Node-type specific extractors check for elements they are interested in here. Everything
// else will be filtered through the switch below.
- // Check for embedded elements that might be extracted.
- if (embedTagNames.contains(e.getTagName())) {
- // If the tag is marked as interesting, check the extractors.
- for (EmbedExtractor extractor : extractors) {
- WebElement embed = extractor.extract(e);
- if (embed != null) {
- builder.embed(embed);
- return false;
+ try {
+ // Check for embedded elements that might be extracted.
+ if (embedTagNames.contains(e.getTagName())) {
+ // If the tag is marked as interesting, check the extractors.
+ for (EmbedExtractor extractor : extractors) {
+ WebElement embed = extractor.extract(e);
+ if (embed != null) {
+ builder.embed(embed);
+ return false;
+ }
}
}
+ } catch (Exception exception) {
+ LogUtil.logToConsole("Exception happened in EmbedExtractors: " + exception.getMessage());
mdjones 2016/08/29 20:52:51 100+ chars?
}
// Skip IFRAMEs not recognized by EmbedExtractors.
« no previous file with comments | « no previous file | javatests/org/chromium/distiller/ContentExtractorTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698