ministryofjustice/sensu-formula — pull request #43 by mikepea (2014-11-19 16:36:07+00:00)
Title: Improve error message when target returns no data.

If an incorrect target was specified, an empty dataset would be
retreived, which in turn made the check fail:

```
ALERT - [aaa-01.lpa-b/graphite-es-heap-used] - Check failed to run: undefined method `empty?'
for nil:NilClass, ["/etc/sensu/plugins/graphite-data.rb:226:in `eval'", "(eval):1:in
`value_to_check'", "/etc/sensu/plugins/graphite-data.rb:226:in `eval'",
"/etc/sensu/plugins/graphite-data.rb:226:in `value_to_check'",
"/etc/sensu/plugins/graphite-data.rb:122:in `run'",
"/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-plugin-0.3.0/lib/sensu-plugin/cli.rb:56:in `block in '"] .
```

This fixes it by shortcircuiting when no (or nil) data is recieved, giving a helpful critical
instead.