Skip to content

Commit

Permalink
fix: Fix error while throwing an error in RequestHelper (#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdalrymple committed Aug 15, 2018
1 parent 66547ad commit 177d7fd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/infrastructure/RequestHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@ async function getPaginated(service, endpoint, options = {}, sleepOnRateLimit =
!err.response.headers ||
!err.response.headers['retry-after'] ||
parseInt(err.statusCode, 10) != 429
) throw error;
) throw err;

const sleepTime = parseInt(err.response.headers['retry-after'], 10);

if (!sleepTime) throw error;
if (!sleepTime) throw err;

await wait(sleepTime * 1000);

Expand Down

0 comments on commit 177d7fd

Please sign in to comment.