Skip to content

Commit

Permalink
Handle too many requests response
Browse files Browse the repository at this point in the history
Signed-off-by: Sönmez Kartal <[email protected]>
  • Loading branch information
szkl committed Jul 25, 2017
1 parent 9d251d7 commit 7bff825
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/slack.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ export default class SlackData extends EventEmitter {
return this.retry()
}

// Too Many Requests
if (res.status == 429) {
return this.retry(res.headers['retry-after'] * 1000)
}

let users = res.body.members

if (!users || (users && !users.length)) {
Expand Down

0 comments on commit 7bff825

Please sign in to comment.