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

Improve error handling when fetching blog feeds #798

Merged
merged 3 commits into from
Dec 13, 2024

Conversation

sserrata
Copy link
Member

Description

Adds additional error handling to the getBlogs and getHashicorpBlogs to prevent build failures when transient errors occur.

Changes include:

  • Running curl commands in --silent mode to suppress output
  • Adding a fall back that writes empty "[]" to json files
  • Combining both commands into getAllFeeds to simplify usage

Other changes:

  • Add optional chaining the Medium component to allow for handling empty json array
  • Add getAllFeeds to start script to help ensure they are always generated/present
  • Update gitignore to ignore feed json files

Motivation and Context

Helps overcome an otherwise annoying developer/contributor experience where running yarn start resulted in an error when blogs/feeds hadn't been fetched. Also, hopefully solves for situations where the curl commands may fail to fetch one or more feeds.

How Has This Been Tested?

Tested locally by using /etc/hosts so simulate a connectivity issue.

@sserrata sserrata added the bug Something isn't working label Dec 13, 2024
@sserrata sserrata self-assigned this Dec 13, 2024
@sserrata sserrata requested a review from a team as a code owner December 13, 2024 17:12
Copy link

Visit the preview URL for this PR (updated for commit 5eb4599):

https://pan-dev-f1b58--pr798-ppyt3ss7.web.app

(expires Sun, 12 Jan 2025 17:56:40 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 9359a9fa100d5fdb082f75280473a90b1f96eb51

@sserrata sserrata merged commit 3256251 into master Dec 13, 2024
6 checks passed
@sserrata sserrata deleted the improve-feeds-handling branch December 13, 2024 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant