flapjack / flapjack-diner

Consumer of the Flapjack API
http://flapjack.io/
MIT License
17 stars 10 forks source link

Flapjack::Diner.downtime_report_entities throws a type error #33

Closed Sarah-E-Greene closed 10 years ago

Sarah-E-Greene commented 10 years ago

Just going through some of the commands in the README:

pry(main)> Flapjack::Diner.downtime_report_entities TypeError: no implicit conversion of String into Integer from /Users/sarah/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/bundler/gems/flapjack-diner-0c144b4f97db/lib/flapjack-diner.rb:391:in `[]'

ghost commented 10 years ago

Fixed in https://github.com/flapjack/flapjack/commit/1b26f908b8ea661b7b71bd802245a1eb4900ccb0 .

Sarah-E-Greene commented 10 years ago

Same occurs for: status_report_checks pry(main)> Flapjack::Diner.status_report_checks TypeError: no implicit conversion of String into Integer from /Users/sarah/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/bundler/gems/flapjack-diner-0c144b4f97db/lib/flapjack-diner.rb:391:in `[]'

ghost commented 10 years ago

This happens when the data to be reported is empty for those two report types (downtime report depends on the outage data, that's also used by status) -- the empty case hadn't been converted during a data structure change.

ghost commented 10 years ago

Closing, as it can't be fixed here.

Sarah-E-Greene commented 10 years ago

My error - I hadn't built off the latest master.

ghost commented 10 years ago

Made diner a little more paranoid in https://github.com/flapjack/flapjack-diner/commit/9bc0dde78255f677dba89a8d46f467c80778ae56 , so it won't error if the GET data's not a hash as expected.