aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/constants.ts6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/constants.ts b/src/constants.ts
index b8761b7..8143381 100644
--- a/src/constants.ts
+++ b/src/constants.ts
@@ -88,8 +88,14 @@ function fetchFile(path: string): Promise<GithubFile> {
'Accept': 'application/vnd.github.v3+json',
},
)
+
const data = await r.json() as any
+ // this happens when the ratelimit is exceeded
+ if (!('path' in data)) {
+ console.error('Error getting GitHub file', data)
+ }
+
const file = {
path: data.path,
content: Buffer.from(data.content, data.encoding).toString(),