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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user