Bug 1141757 - Catch exceptions thrown in ReaderWorker. r=Yoric a=readinglist
authorMargaret Leibovic <margaret.leibovic@gmail.com>
Wed, 11 Mar 2015 08:39:54 -0700
changeset 248422 62207e715de5efdfe038b4dafec9aa9f612e74bf
parent 248421 82be87b08032f3d4512813b25077e9998081c0e7
child 248423 47992ba93d42af911f841011c7306c8763e8d9e0
push id7837
push userjwein@mozilla.com
push dateFri, 27 Mar 2015 00:27:16 +0000
treeherdermozilla-aurora@cb0db44ce60e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersYoric, readinglist
bugs1141757
milestone38.0a2
Bug 1141757 - Catch exceptions thrown in ReaderWorker. r=Yoric a=readinglist
toolkit/components/reader/ReaderMode.jsm
--- a/toolkit/components/reader/ReaderMode.jsm
+++ b/toolkit/components/reader/ReaderMode.jsm
@@ -214,17 +214,22 @@ this.ReaderMode = {
       scheme: uri.scheme,
       pathBase: Services.io.newURI(".", null, uri).spec
     };
 
     let serializer = Cc["@mozilla.org/xmlextras/xmlserializer;1"].
                      createInstance(Ci.nsIDOMSerializer);
     let serializedDoc = yield Promise.resolve(serializer.serializeToString(doc));
 
-    let article = yield ReaderWorker.post("parseDocument", [uriParam, serializedDoc]);
+    let article = null;
+    try {
+      article = yield ReaderWorker.post("parseDocument", [uriParam, serializedDoc]);
+    } catch (e) {
+      Cu.reportError("Error in ReaderWorker: " + e);
+    }
 
     if (!article) {
       this.log("Worker did not return an article");
       return null;
     }
 
     // Readability returns a URI object, but we only care about the URL.
     article.url = article.uri.spec;