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

Detecting if there's no response? #19

Open
tetherit opened this issue Nov 7, 2016 · 0 comments
Open

Detecting if there's no response? #19

tetherit opened this issue Nov 7, 2016 · 0 comments

Comments

@tetherit
Copy link

tetherit commented Nov 7, 2016

It seems there's no way to know if there was no response:

(dev)> response = client.lookup_by_woeid 123123123123
=> #<Weatherman::Response:0x007fee06bfd168 @document_root={"units"=>{"distance"=>"km", "pressure"=>"mb", "speed"=>"km/h", "temperature"=>"C"}}, @i18n=#<Weatherman::I18N:0x007fee06bfcb50 @language=nil>>
(dev)> response.location
NoMethodError: undefined method `size' for nil:NilClass
from /usr/local/lib/ruby/gems/2.3.0/bundler/gems/yahoo_weatherman-cf110fe4f25f/lib/yahoo_weatherman/response.rb:172:in `attribute'

Please add a way to check that there was no response, currently the methods just throw an exception from yahoo_weatherman which I have to rescue from.

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

0 participants