Skip to content

Commit 8cf1a10

Browse files
committed
add error logging
1 parent 83d0300 commit 8cf1a10

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

scripts/fetch-cards.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,14 @@ const fs = require('fs-extra');
1313
'errata',
1414
'i18n/en-US',
1515
].forEach(async (type) => {
16-
const res = await fetch(`https://ledercards.netlify.app/${type}.json`);
17-
const data = await res.json();
16+
try {
17+
const res = await fetch(`https://ledercards.netlify.app/${type}.json`);
18+
const data = await res.json();
1819

19-
fs.writeJsonSync(`ssgdata/${type}.json`, data);
20+
fs.writeJsonSync(`ssgdata/${type}.json`, data);
21+
} catch(e) {
22+
console.error(`failed to fetch ${type}`);
23+
console.error(e);
24+
}
2025
});
2126
})();

0 commit comments

Comments
 (0)