Skip to content

Commit

Permalink
fix(gatsby-source-contentful): Don't ignore errors thrown when fetchi…
Browse files Browse the repository at this point in the history
…ng assets (#24288)

Co-authored-by: Shane Kenney <shane.kenney@lwb.org.au>
  • Loading branch information
shanekenney and Shane Kenney committed Jun 22, 2021
1 parent a6fd7b1 commit 2d4a791
Showing 1 changed file with 13 additions and 17 deletions.
30 changes: 13 additions & 17 deletions packages/gatsby-source-contentful/src/download-contentful-assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,25 +76,21 @@ const downloadContentfulAssets = async gatsbyFunctions => {

// If we don't have cached data, download the file
if (!fileNodeID) {
try {
const fileNode = await createRemoteFileNode({
url,
store,
cache,
createNode,
createNodeId,
getCache,
reporter,
})
const fileNode = await createRemoteFileNode({
url,
store,
cache,
createNode,
createNodeId,
getCache,
reporter,
})

if (fileNode) {
bar.tick()
fileNodeID = fileNode.id
if (fileNode) {
bar.tick()
fileNodeID = fileNode.id

await cache.set(remoteDataCacheKey, { fileNodeID })
}
} catch (err) {
// Ignore
await cache.set(remoteDataCacheKey, { fileNodeID })
}
}

Expand Down

0 comments on commit 2d4a791

Please sign in to comment.