Skip to content

[gatsby-source-filesystem] why createRemoteFileNode failing still resolves the promise? #12280

Description

@antoinerousseau

Summary

When createRemoteFileNode fails to download the remote file (e.g. 404), it still resolves with an empty fileNode, and writes Failed to process remote content {url} to the console:

console.warn(`Failed to process remote content ${task.url}`)

.on(`failed`, () => {
resolve()
})

Why not just reject(error) instead of console.warn() & resolve()?
That would make more sense allowing us to handle the error as we wish, and would avoid polluting the terminal.

Relevant information

Environment (if relevant)

  System:
    OS: macOS 10.14.3
    CPU: (8) x64 Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz
    Shell: 5.3 - /bin/zsh
  Binaries:
    Node: 11.6.0 - /usr/local/bin/node
    Yarn: 1.13.0 - /usr/local/bin/yarn
    npm: 6.8.0 - /usr/local/bin/npm
  Languages:
    Python: 2.7.15 - /usr/local/bin/python
  Browsers:
    Chrome: 72.0.3626.119
    Firefox: 65.0.1
    Safari: 12.0.3
  npmPackages:
    gatsby: ^2.1.20 => 2.1.20
    gatsby-image: ^2.0.31 => 2.0.31
    gatsby-plugin-manifest: ^2.0.21 => 2.0.21
    gatsby-plugin-netlify: ^2.0.11 => 2.0.11
    gatsby-plugin-offline: ^2.0.24 => 2.0.24
    gatsby-plugin-react-helmet: ^3.0.7 => 3.0.7
    gatsby-plugin-sharp: ^2.0.24 => 2.0.24
    gatsby-plugin-styled-components: ^3.0.6 => 3.0.6
    gatsby-plugin-typescript: ^2.0.10 => 2.0.10
    gatsby-source-filesystem: ^2.0.23 => 2.0.23
    gatsby-transformer-sharp: ^2.1.15 => 2.1.15
  npmGlobalPackages:
    gatsby-cli: 2.4.12

File contents (if changed)

gatsby-config.js: N/A
package.json: N/A
gatsby-node.js: N/A
gatsby-browser.js: N/A
gatsby-ssr.js: N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueIssue that doesn't require previous experience with Gatsbytype: question or discussionIssue discussing or asking a question about Gatsby

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions