Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle 403 gracefully #4

Open
petems opened this issue Jul 3, 2013 · 0 comments
Open

Handle 403 gracefully #4

petems opened this issue Jul 3, 2013 · 0 comments

Comments

@petems
Copy link

petems commented Jul 3, 2013

It's quite easy to get rate-limited whilst using the gem I've found out.

Would be cool to add a way of handling 403's gracefully 👍

When using the

{
  "message": "API Rate Limit Exceeded for <ip address>"
}

Current behaviour:

from /opt/boxen/rbenv/versions/1.9.3-p392/lib/ruby/1.9.1/open-uri.rb:775:in `buffer_open'
    from /opt/boxen/rbenv/versions/1.9.3-p392/lib/ruby/1.9.1/open-uri.rb:203:in `block in open_loop'
    from /opt/boxen/rbenv/versions/1.9.3-p392/lib/ruby/1.9.1/open-uri.rb:201:in `catch'
    from /opt/boxen/rbenv/versions/1.9.3-p392/lib/ruby/1.9.1/open-uri.rb:201:in `open_loop'
    from /opt/boxen/rbenv/versions/1.9.3-p392/lib/ruby/1.9.1/open-uri.rb:146:in `open_uri'
    from /opt/boxen/rbenv/versions/1.9.3-p392/lib/ruby/1.9.1/open-uri.rb:677:in `open'
    from /opt/boxen/rbenv/versions/1.9.3-p392/lib/ruby/1.9.1/open-uri.rb:33:in `open'
    from /opt/boxen/rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/contributions-0.2.0/lib/contributions/github_api.rb:40:in `repos'
    from /opt/boxen/rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/contributions-0.2.0/lib/contributions/github_api.rb:11:in `forks'
    from /opt/boxen/rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/contributions-0.2.0/lib/contributions/contributions.rb:130:in `setup_repositories'
    from /opt/boxen/rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/contributions-0.2.0/lib/contributions/contributions.rb:11:in `initialize'
    from testscript.rb:4:in `new'
    from testscript.rb:4:in `<main>'

Possible new behaviour:

Warning: You have exceeded your API limit, please wait
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant