Skip to content

Commit

Permalink
Don't use internal name when reporting there's an error in gatsby-nod…
Browse files Browse the repository at this point in the history
…e.js fixes #2945
  • Loading branch information
KyleAMathews committed Jan 15, 2018
1 parent 936c33a commit 0bc1194
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/gatsby/src/utils/api-runner-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,17 @@ module.exports = async (api, args = {}, pluginSource) =>
mapSeries(
noSourcePluginPlugins,
(plugin, callback) => {
currentPluginName = plugin.name
let currentPluginName
if (plugin.name === `default-site-plugin`) {
currentPluginName = `gatsby-node.js`
} else {
currentPluginName = `Plugin ${plugin.name}`
}
Promise.resolve(runAPI(plugin, api, args)).asCallback(callback)
},
(err, results) => {
if (err) {
reporter.error(`Plugin ${currentPluginName} returned an error`, err)
reporter.error(`${currentPluginName} returned an error`, err)
}
// Remove runner instance
apisRunning = apisRunning.filter(runner => runner !== apiRunInstance)
Expand Down

0 comments on commit 0bc1194

Please sign in to comment.