Bug 1952046 - Newtab fixing edge case error state so at least content can still load r=home-newtab-reviewers,mconley

Differential Revision: https://phabricator.services.mozilla.com/D241104
This commit is contained in:
scottdowne
2025-03-14 03:33:23 +00:00
parent 5be0942cc7
commit 7edfeb11f4

View File

@@ -1181,11 +1181,16 @@ export class DiscoveryStreamFeed {
const headers = new Headers();
headers.append("content-type", "application/json");
const spocsResponse = await this.fetchFromEndpoint(endpoint, {
method: "POST",
headers,
body: JSON.stringify(body),
});
let spocsResponse;
try {
spocsResponse = await this.fetchFromEndpoint(endpoint, {
method: "POST",
headers,
body: JSON.stringify(body),
});
} catch (error) {
console.error("Error trying to load spocs feeds:", error);
}
if (spocsResponse) {
const fetchTimestamp = Date.now();