Skip to content

Commit

Permalink
fix(gatsby-source-filesystem): createRemoteFileNode rejects promise i…
Browse files Browse the repository at this point in the history
…nstead resolving on failure (#12348)
  • Loading branch information
antoinerousseau authored and wardpeet committed May 15, 2019
1 parent 20b63b5 commit c2c5cea
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ async function pushToQueue(task, cb) {
const node = await processRemoteNode(task)
return cb(null, node)
} catch (e) {
console.warn(`Failed to process remote content ${task.url}`)
return cb(e)
}
}
Expand Down Expand Up @@ -267,8 +266,8 @@ const pushTask = task =>
.on(`finish`, task => {
resolve(task)
})
.on(`failed`, () => {
resolve()
.on(`failed`, err => {
reject(`failed to process ${task.url}\n${err}`)
})
})

Expand Down Expand Up @@ -327,9 +326,7 @@ module.exports = ({
}

if (!url || isWebUri(url) === undefined) {
// should we resolve here, or reject?
// Technically, it's invalid input
return Promise.resolve()
return Promise.reject(`wrong url: ${url}`)
}

totalJobs += 1
Expand Down

0 comments on commit c2c5cea

Please sign in to comment.