Open mdpatrick opened 10 years ago
I figured out what precipitates this... I still think it qualifies as a bug since it's sort of an inappropriate exception it's raising, but I confess... I'm a goober for not having realized what was going on!
[5] pry(main)> oauth = AWeber::OAuth.new(nil, nil)
[6] pry(main)> oauth.authorize_with_access(nil, nil)
[7] pry(main)> aweber = AWeber::Base.new(oauth)
=> #<AWeber::Base />
[8] pry(main)> list = aweber.account.lists.find_by_name('foundmyfitness')
ArgumentError: bad value for range
I was using environmental variables for oauth, and it appears they weren't available for some strange reason. (They're available to my shell on the server, so I'll have to figure out what's going on there but that's on me!)
I totally agree! The exception returned should tell your app what's wrong. Our API already does this, so the client library should just pass it thru as an exception.
Hey mdpatrick how did you fix this issue? I am having the same problem. I can access everything when I am using the rails console, but I get that error when I try make API calls in my rails code.
@ednsystems I supplied my appropriate oauth key! It was only when it was omitted that I was getting this error. Oops.
@mdpatrick thank you for you response. My issue was my oath key not getting passed when called.
@ednsystems you may be using your consumer and secret keys to authorize_with_access. Those two args take differnent sets of keys. e.g. (access vs. consumer)
oauth = AWeber::OAuth.new(ENV['AWEBER_CONSUMER_KEY'], ENV['AWEBER_SECRET_KEY'])
oauth.authorize_with_access(ENV['AWEBER_ACCESS_KEY'], ENV['AWEBER_ACCESS_SECRET'])
aweber = AWeber::Base.new(oauth)
list = aweber.account.lists.find_by_name("MY_LIST")
While this example is written in python/php, it shows that there are actually FOUR unique keys.
Running into a somewhat unusual error. Not sure what to make of it...
This is triggered by the last line (the one using find_by_name) immediately after authentication: