Skip to content

Commit c2c5cea

Browse files
antoinerousseauwardpeet
authored andcommitted
fix(gatsby-source-filesystem): createRemoteFileNode rejects promise instead resolving on failure (#12348)
1 parent 20b63b5 commit c2c5cea

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

packages/gatsby-source-filesystem/src/create-remote-file-node.js

+3-6
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ async function pushToQueue(task, cb) {
105105
const node = await processRemoteNode(task)
106106
return cb(null, node)
107107
} catch (e) {
108-
console.warn(`Failed to process remote content ${task.url}`)
109108
return cb(e)
110109
}
111110
}
@@ -267,8 +266,8 @@ const pushTask = task =>
267266
.on(`finish`, task => {
268267
resolve(task)
269268
})
270-
.on(`failed`, () => {
271-
resolve()
269+
.on(`failed`, err => {
270+
reject(`failed to process ${task.url}\n${err}`)
272271
})
273272
})
274273

@@ -327,9 +326,7 @@ module.exports = ({
327326
}
328327

329328
if (!url || isWebUri(url) === undefined) {
330-
// should we resolve here, or reject?
331-
// Technically, it's invalid input
332-
return Promise.resolve()
329+
return Promise.reject(`wrong url: ${url}`)
333330
}
334331

335332
totalJobs += 1

0 commit comments

Comments
 (0)