зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1152412 - Handle errors downloading and parsing documents for reader view. r=bnicholson
--HG-- extra : rebase_source : 3bb7f0207971e48445ad46ddc28d2855d8ba1c3f
This commit is contained in:
Родитель
bff6d53b6d
Коммит
ef66ed11a8
|
@ -214,6 +214,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;
|
||||
});
|
||||
})
|
||||
};
|
||||
|
|
|
@ -287,7 +287,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) {
|
||||
|
|
|
@ -131,6 +131,10 @@ this.ReaderMode = {
|
|||
}
|
||||
|
||||
let doc = xhr.responseXML;
|
||||
if (!doc) {
|
||||
reject("Reader mode XHR didn't return a document");
|
||||
return;
|
||||
}
|
||||
|
||||
// Manually follow a meta refresh tag if one exists.
|
||||
let meta = doc.querySelector("meta[http-equiv=refresh]");
|
||||
|
|
Загрузка…
Ссылка в новой задаче