Skip to content

fix(gatsby-source-filesystem,gatsby-transformer-sharp): Use custom errors - #27576

Merged
LekoArts merged 1 commit into
gatsbyjs:masterfrom
ax-vasquez:armandovasquez/ch17057/useReporterForUnableToCopyError
Oct 26, 2020
Merged

fix(gatsby-source-filesystem,gatsby-transformer-sharp): Use custom errors#27576
LekoArts merged 1 commit into
gatsbyjs:masterfrom
ax-vasquez:armandovasquez/ch17057/useReporterForUnableToCopyError

Conversation

@ax-vasquez

@ax-vasquez ax-vasquez commented Oct 20, 2020

Copy link
Copy Markdown
Contributor

Description

Related to Cloud functionality

In effort to improve the Cloud user experience, we need to make sure "Error copying file from..." errors are appropriately captured/categorized for Builds and Previews.

This PR simply updates the locations where log this error so that it uses reporter.panic instead of console.error

To do

  1. What id should be used for this error? - Any 5-digit number; this is an arbitrary value and contained within the context of the plugin (e.g., there is no risk error code conflicts between modules)
    • Should the id be different between gatsby-source-filesystem and gatsby-transformer-sharp (the two places that log this error) - Yes, the module name is included in the ID prefix for both error locations.

@gatsbot gatsbot Bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Oct 20, 2020
Comment thread packages/gatsby-source-filesystem/src/extend-file-node.js Outdated
Comment thread packages/gatsby-transformer-sharp/src/customize-schema.js Outdated
@LekoArts LekoArts added topic: plugins Related to plugin system, themes & catch-all for plugins that don't have a label and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Oct 21, 2020

@LekoArts LekoArts left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some (hopefully) helpful comments. For reference, this was the PR adding the same logic in another plugin: #27441

Comment thread packages/gatsby-source-filesystem/src/extend-file-node.js Outdated
Comment thread packages/gatsby-source-filesystem/src/extend-file-node.js Outdated
Comment thread packages/gatsby-transformer-sharp/src/customize-schema.js Outdated
Comment thread packages/gatsby-transformer-sharp/src/customize-schema.js Outdated
@ax-vasquez
ax-vasquez requested a review from LekoArts October 21, 2020 17:14
@ax-vasquez
ax-vasquez marked this pull request as ready for review October 21, 2020 17:20

@LekoArts LekoArts left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two more smaller requests, rest looks good

Comment thread packages/gatsby-source-filesystem/src/error-utils.js Outdated
Comment thread packages/gatsby-transformer-sharp/src/error-utils.js Outdated
Comment thread packages/gatsby-transformer-sharp/src/gatsby-node.js Outdated
@ax-vasquez
ax-vasquez requested a review from a team October 23, 2020 15:06

@LekoArts LekoArts left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@LekoArts LekoArts changed the title Use reporter.panic call when unable to copy files instead of console.error fix(gatsby-source-filesystem,gatsby-transformer-sharp): Use custom errors Oct 26, 2020
@LekoArts
LekoArts merged commit 752e27a into gatsbyjs:master Oct 26, 2020
@ax-vasquez
ax-vasquez deleted the armandovasquez/ch17057/useReporterForUnableToCopyError branch October 26, 2020 17:39
mwfrost pushed a commit to mwfrost/gatsby that referenced this pull request Apr 20, 2023
raffishquartan pushed a commit to raffishquartan/gatsby that referenced this pull request Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic: plugins Related to plugin system, themes & catch-all for plugins that don't have a label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants