File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,15 +39,19 @@ exports.createPages = ({ actions, graphql }) => {
3939 const edges = res . data . allFile . edges
4040 for ( let i = 0 ; i < edges . length ; i ++ ) {
4141 const filename = edges [ i ] . node . name
42- const { data : contributorsRaw } = await axios . get (
43- `https://api.github.com/repos/devsonket/devsonket.github.io/commits?path=data/${ filename } .json` ,
44- {
45- headers : {
46- Authorization : `Bearer ${ process . env . GATSBY_GITHUB_TOKEN } ` ,
47- } ,
48- }
49- )
50- contributors [ filename ] = contributorMap ( contributorsRaw )
42+ try {
43+ const { data : contributorsRaw } = await axios . get (
44+ `https://api.github.com/repos/devsonket/devsonket.github.io/commits?path=data/${ filename } .json` ,
45+ {
46+ headers : {
47+ Authorization : `Bearer ${ process . env . GATSBY_GITHUB_TOKEN } ` ,
48+ } ,
49+ }
50+ )
51+ contributors [ filename ] = contributorMap ( contributorsRaw )
52+ } catch {
53+ contributors [ filename ] = { }
54+ }
5155 }
5256 res . data . allFile . edges . map ( ( { node } ) => {
5357 const filename = node . name
You can’t perform that action at this time.
0 commit comments