Bug 1152412 - Handle errors downloading and parsing documents for reader view. r=bnicholson a=lmandel

This commit is contained in:
Margaret Leibovic
2015-04-10 14:41:14 -07:00
parent 646dc2f5d0
commit 39e59124d2
2 changed files with 8 additions and 2 deletions

View File

@@ -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;
});
})
};

View File

@@ -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) {