We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent debaa77 commit 8698f1aCopy full SHA for 8698f1a
src/lib/api/fetchGitHistory.ts
@@ -38,7 +38,13 @@ async function fetchWithRateLimit(
38
continue
39
}
40
41
- return await response.json()
+ if (!response.ok) throw new Error(response.statusText)
42
+ const json = await response.json()
43
+ if (!Array.isArray(json)) {
44
+ console.warn("Unexpected response from GitHub API", json)
45
+ return []
46
+ }
47
+ return json
48
49
50
@@ -59,6 +65,7 @@ export const fetchAndSaveGitHistory = async (mdDir: string) => {
59
65
(await fetchWithRateLimit(
60
66
filepath.replace(CONTENT_DIR, OLD_CONTENT_DIR)
61
67
)) || []
68
+
62
69
// Transform commitHistory
63
70
const contributors = [...history, ...legacyHistory]
64
71
.filter(({ author }) => !!author)
0 commit comments