fix(github): detect rate limit correctly

This commit is contained in:
Rhys Arkins 2018-07-23 13:11:56 +02:00
parent 8ffd29ea19
commit 2bb97240f1
2 changed files with 2 additions and 2 deletions

View file

@ -139,7 +139,7 @@ async function get(path, options, retries = 5) {
},
'Bad credentials'
);
if (rateLimit === 60) {
if (rateLimit === '60') {
throw new Error('platform-failure');
}
throw new Error('bad-credentials');

View file

@ -96,7 +96,7 @@ describe('platform/gh-got-wrapper', () => {
statusCode: 401,
message: 'Bad credentials. (401)',
headers: {
'x-ratelimit-limit': 60,
'x-ratelimit-limit': '60',
},
})
);