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