On Oct 13, 2009, at 6:46 PM, Steven Jenkins wrote: > > On Tue, Oct 13, 2009 at 9:29 PM, <[email protected]> wrote: >> >> From: Rein Henrichs <[email protected]> >> >> Use Puppet::Util.execute to run the config_version command and >> reraise >> its potential Puppet::ExecutionFailure exception as a more useful >> Pupppet::ParseError >> ... >> - @version = %x{#{Puppet[:config_version]}}.chomp >> + @version = >> Puppet::Util.execute([Puppet[:config_version]]).strip >> + >> + rescue Puppet::ExecutionFailure => e >> + raise Puppet::ParseError, "Unable to set config_version: >> #{e.message}" >> end >> > > Why Puppet::ParseError?
Basically, because it's an error that happens during the parsing process. We don't exactly have a "planned" error management system. One of the things I hope to have a chance to do at some point is build an actual plan, and change how errors are managed internally (e.g., probably have every kind of failure generate a different class of exception). -- The whole secret of life is to be interested in one thing profoundly and in a thousand things well. -- Horace Walpole --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en -~----------~----~----~----~------~----~------~--~---
