Bug 1812006 - Port bug 1808400: Replace Cu.reportError with console.error in promise callbacks. r=aleca

Differential Revision: https://phabricator.services.mozilla.com/D167646

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Martin Giger 2023-01-24 17:17:28 +00:00
Родитель 32293d030d
Коммит 3fc0f7fc5d
4 изменённых файлов: 10 добавлений и 13 удалений

Просмотреть файл

@ -30,12 +30,12 @@ var DownloadsView = {
Downloads.getList(Downloads.ALL)
.then(list => list.addView(this))
.then(null, Cu.reportError);
.catch(console.error);
window.addEventListener("unload", aEvent => {
Downloads.getList(Downloads.ALL)
.then(list => list.removeView(this))
.then(null, Cu.reportError);
.catch(console.error);
window.controllers.removeController(this);
});
},
@ -110,7 +110,7 @@ var DownloadsView = {
clearDownloads() {
Downloads.getList(Downloads.ALL)
.then(list => list.removeFinished())
.then(null, Cu.reportError);
.catch(console.error);
},
searchDownloads() {
@ -331,7 +331,7 @@ DownloadItem.prototype = {
launch() {
if (this.download.succeeded) {
this.download.launch().then(null, Cu.reportError);
this.download.launch().catch(console.error);
}
},
@ -339,7 +339,7 @@ DownloadItem.prototype = {
Downloads.getList(Downloads.ALL)
.then(list => list.remove(this.download))
.then(() => this.download.finalize(true))
.then(null, Cu.reportError);
.catch(console.error);
},
show() {

Просмотреть файл

@ -95,7 +95,7 @@ function open_about_support() {
let l10nDone = false;
tab.browser.contentDocument.l10n.ready.then(
() => (l10nDone = true),
Cu.reportError
console.error
);
mc.waitFor(() => l10nDone, "Timeout waiting for L10n to complete.");

Просмотреть файл

@ -70,10 +70,7 @@ var downloadsView = {
succeededPromises.push(succeededPromise);
}
let finished = false;
Promise.all(succeededPromises).then(
() => (finished = true),
Cu.reportError
);
Promise.all(succeededPromises).then(() => (finished = true), console.error);
mc.waitFor(() => finished, "Timeout waiting for downloads to complete.");
},
};
@ -119,7 +116,7 @@ function prepare_downloads_view() {
let success = false;
downloads.Downloads.getList(downloads.Downloads.ALL)
.then(list => list.addView(downloadsView))
.then(() => (success = true), Cu.reportError);
.then(() => (success = true), console.error);
mc.waitFor(() => success, "Timeout waiting for attaching our download view.");
}
@ -366,7 +363,7 @@ function teardownTest() {
list.remove(download);
}
})
.then(null, Cu.reportError);
.catch(console.error);
mc.waitFor(
() => downloadsView.count == 0,
"Timeout waiting for clearing all saved attachment files."

Просмотреть файл

@ -87,7 +87,7 @@ add_setup(function() {
}
let finished = false;
buildFontList().then(() => (finished = true), Cu.reportError);
buildFontList().then(() => (finished = true), console.error);
mc.waitFor(
() => finished,
"Timeout waiting for font enumeration to complete."