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

paginated_resource raises error with no api key set #59

Open
imogenkinsman opened this issue Aug 1, 2015 · 2 comments
Open

paginated_resource raises error with no api key set #59

imogenkinsman opened this issue Aug 1, 2015 · 2 comments

Comments

@imogenkinsman
Copy link

client = DropletKit::Client.new(access_token: nil)
client.droplets.all.each do |droplet|
  puts droplet.name
end
=> TypeError: no implicit conversion of String into Array
from /Users/jadems/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/droplet_kit-1.2.3/lib/droplet_kit/paginated_resource.rb:68:in `retrieve'
from /Users/jadems/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/droplet_kit-1.2.3/lib/droplet_kit/paginated_resource.rb:60:in `fetch_next_page'
from /Users/jadems/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/droplet_kit-1.2.3/lib/droplet_kit/paginated_resource.rb:26:in `each'

I had a misconfigured environment and spent a few minutes trying to figure out why I was getting this. It might be helpful to handle authentication errors more gracefully.

@phillbaker
Copy link
Contributor

Thanks for opening an issue @jademcgough! We'll get this on the list of things to look at.

@techrah
Copy link

techrah commented Aug 16, 2015

I was just wondering myself how to gracefully handle such errors. Looking forward to a solution. Thanks!

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

3 participants