Browse Source

Merge pull request #214 from reactjs/gatsby-plugin-error-codes-fix

Make gatsby-source-react-error-codes plugin fail harder
main
Brian Vaughn 7 years ago
committed by GitHub
parent
commit
40de6b302e
  1. 8
      plugins/gatsby-source-react-error-codes/gatsby-node.js

8
plugins/gatsby-source-react-error-codes/gatsby-node.js

@ -6,6 +6,7 @@ const errorCodesUrl =
exports.sourceNodes = async ({boundActionCreators}) => {
const {createNode} = boundActionCreators;
try {
const jsonString = await request(errorCodesUrl);
createNode({
@ -17,4 +18,11 @@ exports.sourceNodes = async ({boundActionCreators}) => {
contentDigest: jsonString,
},
});
} catch (error) {
console.error(
`The gatsby-source-react-error-codes plugin has failed:\n${error.message}`,
);
process.exit(1);
}
};

Loading…
Cancel
Save