From ab7fe254267611f030840da465ea4d61c6f4fa78 Mon Sep 17 00:00:00 2001 From: Matthew Dawson Date: Sun, 5 Mar 2017 22:43:20 -0500 Subject: [PATCH] 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. --- lib/binaries/config_source.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/binaries/config_source.ts b/lib/binaries/config_source.ts index 02872615..1cf9f408 100644 --- a/lib/binaries/config_source.ts +++ b/lib/binaries/config_source.ts @@ -156,8 +156,10 @@ export abstract class GithubApiConfigSource extends JsonConfigSource { resolve(output); }); + } else if (response.statusCode == 403 && response.headers['x-ratelimit-remaining'] == 0) { + reject(new Error('Failed to make Github request, rate limit reached.')); } else { - reject(new Error('response status code is not 200')); + reject(new Error('response status code is not 200. It was ' + response.statusCode)); } }) });