sensu/sensu-plugin — pull request #63 by nstielau (2014-02-10 18:06:18+00:00)
Title: Improve the UX for handler debugging by validating handler configs.

Another handler UX idea.

This fail-fast approach should save folks some time debugging handler issues. This is, however, backwards-incompatible, as some bogus, unrelated bad config file could break all handlers.

Another idea would be to only validate the config if the `handle` method raises and exception. That way, it would be specific to the handlers (not global for all handlers, so it wouldn't break as described above). It's definitely not as pretty in code, but it could give some nice feedback to users and make debugging quite easy.

Thinking about it more, I like the idea of catching exceptions from `handle` and then validating the settings, printing a message, and re-raising.

Thoughts?