mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-23 20:23:08 +00:00
Merge pull request #214 from reactjs/gatsby-plugin-error-codes-fix
Make gatsby-source-react-error-codes plugin fail harder
This commit is contained in:
@@ -6,15 +6,23 @@ const errorCodesUrl =
|
||||
exports.sourceNodes = async ({boundActionCreators}) => {
|
||||
const {createNode} = boundActionCreators;
|
||||
|
||||
const jsonString = await request(errorCodesUrl);
|
||||
try {
|
||||
const jsonString = await request(errorCodesUrl);
|
||||
|
||||
createNode({
|
||||
id: 'error-codes',
|
||||
children: [],
|
||||
parent: 'ERRORS',
|
||||
internal: {
|
||||
type: 'ErrorCodesJson',
|
||||
contentDigest: jsonString,
|
||||
},
|
||||
});
|
||||
createNode({
|
||||
id: 'error-codes',
|
||||
children: [],
|
||||
parent: 'ERRORS',
|
||||
internal: {
|
||||
type: 'ErrorCodesJson',
|
||||
contentDigest: jsonString,
|
||||
},
|
||||
});
|
||||
} catch (error) {
|
||||
console.error(
|
||||
`The gatsby-source-react-error-codes plugin has failed:\n${error.message}`,
|
||||
);
|
||||
|
||||
process.exit(1);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user