puppetlabs/facter — pull request #197 by kbarber (2012-05-06 23:24:31+00:00)
Title: Ticket/1.6.x/14338 trace should work within setcode

This patch fixes the case whereby you want to see stack traces for failures
within a setcode block. Errors were hard to follow without this, and the option
--trace should have really worked but I don't think it ever did for this
particular case.

Now, we have a global option for tracing in Facter - and when it is enabled
Facter::Util::Resolution modifies its returned error during a rescue to include
the full backtrace debugging instead of just the main error.

This also correct the behaviour whereby warnings weren't raised as
Facter.warn, they were instead using kernel warnings so they were not
managed properly.

To facilitate the Facter#tracing method I have cherry-picked the bitcheck
feature from a development branch as its more robust and requires less copy and
paste coding. Future code was going to use this anyway.