Skip to content

Add error handling for fetch request in loadTaggings#31

Closed
Copilot wants to merge 3 commits intofetch-tagsfrom
copilot/sub-pr-30
Closed

Add error handling for fetch request in loadTaggings#31
Copilot wants to merge 3 commits intofetch-tagsfrom
copilot/sub-pr-30

Conversation

Copy link
Copy Markdown

Copilot AI commented Oct 31, 2025

Addresses missing error handling in the loadTaggings method that fetches CSV data from the google/fonts repository. Without proper error handling, network failures or HTTP errors would silently fail.

Changes

  • Check response.ok before processing response text
  • Throw descriptive error with HTTP status on failed requests
  • Add .catch() block to log fetch and processing errors
fetch(tagsUrl)
  .then((response) => {
    if (!response.ok) {
      throw new Error(`Failed to fetch tags: ${response.status} ${response.statusText}`);
    }
    return response.text();
  })
  .then((csvText) => {
    // Process CSV...
  })
  .catch((error) => {
    console.error("Error loading taggings from CSV:", error);
  });

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

m4rc1e and others added 2 commits October 31, 2025 15:53
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@google-cla
Copy link
Copy Markdown

google-cla bot commented Oct 31, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Co-authored-by: davelab6 <261579+davelab6@users.noreply.github.com>
Copilot AI changed the title [WIP] Address feedback on loading tags from CSV Add error handling for fetch request in loadTaggings Oct 31, 2025
Copilot AI requested a review from davelab6 October 31, 2025 17:34
@m4rc1e m4rc1e deleted the branch fetch-tags April 13, 2026 09:21
@m4rc1e m4rc1e closed this Apr 13, 2026
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