Skip to content

Conversation

Copy link

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.

@google-cla
Copy link

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.

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
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.

1 participant