We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 83d0300 commit 8cf1a10Copy full SHA for 8cf1a10
1 file changed
scripts/fetch-cards.ts
@@ -13,9 +13,14 @@ const fs = require('fs-extra');
13
'errata',
14
'i18n/en-US',
15
].forEach(async (type) => {
16
- const res = await fetch(`https://ledercards.netlify.app/${type}.json`);
17
- const data = await res.json();
+ try {
+ const res = await fetch(`https://ledercards.netlify.app/${type}.json`);
18
+ const data = await res.json();
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
+ }
25
});
26
})();
0 commit comments