From 39e59124d26eda9ab3d77a5e036ffe8eb2a05d50 Mon Sep 17 00:00:00 2001 From: Margaret Leibovic Date: Fri, 10 Apr 2015 14:41:14 -0700 Subject: [PATCH] Bug 1152412 - Handle errors downloading and parsing documents for reader view. r=bnicholson a=lmandel --- browser/modules/ReaderParent.jsm | 5 ++++- mobile/android/chrome/content/Reader.js | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/browser/modules/ReaderParent.jsm b/browser/modules/ReaderParent.jsm index 0bdd6c482978..fcfadf1b5d90 100644 --- a/browser/modules/ReaderParent.jsm +++ b/browser/modules/ReaderParent.jsm @@ -258,6 +258,9 @@ let ReaderParent = { * @resolves JS object representing the article, or null if no article is found. */ _getArticle: Task.async(function* (url, browser) { - return yield ReaderMode.downloadAndParseDocument(url); + return yield ReaderMode.downloadAndParseDocument(url).catch(e => { + Cu.reportError("Error downloading and parsing document: " + e); + return null; + }); }) }; diff --git a/mobile/android/chrome/content/Reader.js b/mobile/android/chrome/content/Reader.js index 3b82dc6f9ce4..9792386a1365 100644 --- a/mobile/android/chrome/content/Reader.js +++ b/mobile/android/chrome/content/Reader.js @@ -285,7 +285,10 @@ let Reader = { // Article hasn't been found in the cache, we need to // download the page and parse the article out of it. - return yield ReaderMode.downloadAndParseDocument(url); + return yield ReaderMode.downloadAndParseDocument(url).catch(e => { + Cu.reportError("Error downloading and parsing document: " + e); + return null; + });; }), _getSavedArticle: function(browser) {