Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core] Swallow ad blocker fetch fail #33617

Merged
merged 1 commit into from
Jul 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion docs/src/modules/components/AdCarbon.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,14 @@ export function AdCarbonInline(props) {
}

attempt += 1;
const response = await fetch('https://srv.buysellads.com/ads/CE7DC23W.json');
let response;
try {
response = await fetch('https://srv.buysellads.com/ads/CE7DC23W.json');
} catch (err) {
// Ad blocker crashes this request
return null;
}

const data = await response.json();
// Inspired by https://github.com/Semantic-Org/Semantic-UI-React/blob/2c7134128925dd831de85011e3eb0ec382ba7f73/docs/src/components/CarbonAd/CarbonAdNative.js#L9
const sanitizedAd = data.ads
Expand Down