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
Sönmez Kartal committed Mar 23, 2017
1 parent 1ff4904 commit ee1b975
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 ee1b975

Please sign in to comment.