File tree Expand file tree Collapse file tree 1 file changed +18
-10
lines changed
plugins/gatsby-source-react-error-codes Expand file tree Collapse file tree 1 file changed +18
-10
lines changed Original file line number Diff line number Diff line change @@ -6,15 +6,23 @@ const errorCodesUrl =
6
6
exports . sourceNodes = async ( { boundActionCreators} ) => {
7
7
const { createNode} = boundActionCreators ;
8
8
9
- const jsonString = await request ( errorCodesUrl ) ;
9
+ try {
10
+ const jsonString = await request ( errorCodesUrl ) ;
10
11
11
- createNode ( {
12
- id : 'error-codes' ,
13
- children : [ ] ,
14
- parent : 'ERRORS' ,
15
- internal : {
16
- type : 'ErrorCodesJson' ,
17
- contentDigest : jsonString ,
18
- } ,
19
- } ) ;
12
+ createNode ( {
13
+ id : 'error-codes' ,
14
+ children : [ ] ,
15
+ parent : 'ERRORS' ,
16
+ internal : {
17
+ type : 'ErrorCodesJson' ,
18
+ contentDigest : jsonString ,
19
+ } ,
20
+ } ) ;
21
+ } catch ( error ) {
22
+ console . error (
23
+ `The gatsby-source-react-error-codes plugin has failed:\n${ error . message } ` ,
24
+ ) ;
25
+
26
+ process . exit ( 1 ) ;
27
+ }
20
28
} ;
You can’t perform that action at this time.
0 commit comments