Skip to content

Commit ce11048

Browse files
committed
feat(gecko): Improve error message when Github api limit reached.
When the Github API limit is reached, the error message now directly informs the user. Also, when any other failure occurs the status code is reported. This should hopefully give more info for issue #216.
1 parent 2cffd30 commit ce11048

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/binaries/config_source.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,11 @@ export abstract class GithubApiConfigSource extends JsonConfigSource {
157157
});
158158

159159
} else {
160-
reject(new Error('response status code is not 200'));
160+
if (response.statusCode == 403 && response.headers['x-ratelimit-remaining'] == 0) {
161+
reject(new Error('Failed to make Github request, rate limit reached.'));
162+
} else {
163+
reject(new Error('response status code is not 200. It was ' + response.statusCode));
164+
}
161165
}
162166
})
163167
});

0 commit comments

Comments
 (0)