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

Tolerate specref API failures during local dev #4167

Merged
merged 1 commit into from
Dec 6, 2024

Conversation

kfranqueiro
Copy link
Contributor

@kfranqueiro kfranqueiro commented Dec 6, 2024

Since #4124 was merged, all builds require an HTTP request to api.specref.org in order to resolve additional bibliographical references. This may cause issues in local dev in the case of being offline due to travel or internet hiccups, behind a proxy, etc.

This commit adds a reusable function for cases where a HTTP failure during local dev is tolerable, and uses it for the bibrefs request.

After this change, a HTTP failure on this request would look something like this, and the dev server will continue running rather than crashing with a stack trace:

AxiosError: status 403 received from https://api.specref.org/bibrefs?refs=WCAG21,WCAG20,WAI-WEBCONTENT,RFC2119,HTML,css3-values,SRGB,UAAG10,LAALS,HEARING-AID-INT,ISO-9241-3,ANSI-HFES-100-1988,ARDITI-FAYE,ARDITI-KNOBLAUCH-1994,ARDITI-KNOBLAUCH-1996,ARDITI,GITTINGS-FOZARD,pointerevents

Running npm build will still result in an immediate failure and stack trace; this is intentional to ensure that nothing slips by during builds for PR previews, GitHub Pages, or w3.org.

@kfranqueiro kfranqueiro requested a review from fstrr December 6, 2024 22:51
Copy link

netlify bot commented Dec 6, 2024

Deploy Preview for wcag2 ready!

Name Link
🔨 Latest commit 50eef91
🔍 Latest deploy log https://app.netlify.com/sites/wcag2/deploys/67537fedfb42e70008cdd6e7
😎 Deploy Preview https://deploy-preview-4167--wcag2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@w3cbot
Copy link

w3cbot commented Dec 6, 2024

kfranqueiro marked as non substantive for IPR from ash-nazg.

@kfranqueiro kfranqueiro merged commit fd31159 into main Dec 6, 2024
5 checks passed
@kfranqueiro kfranqueiro deleted the kgf-tolerate-biblio-failure branch December 6, 2024 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants