On Dec 9, 2009, at 11:46 AM, Markus Roberts wrote: > Pass line and file to exception. A more general solution to these > sorts of issues is on the code smell list. > > Signed-off-by: Markus Roberts <[email protected]> > --- > lib/puppet/type/file.rb | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/lib/puppet/type/file.rb b/lib/puppet/type/file.rb > index a4666a9..6361dd0 100644 > --- a/lib/puppet/type/file.rb > +++ b/lib/puppet/type/file.rb > @@ -31,7 +31,7 @@ module Puppet > > validate do |value| > unless value =~ /^#{File::SEPARATOR}/ > - raise Puppet::Error, "File paths must be fully > qualified, not '%s'" % value > + raise Puppet::Error.new("File paths must be > fully qualified, not '#{value}",line,file) > end > end
Note that the 'fail' method in resource types does this automatically. -- A little government and a little luck are necessary in life, but only a fool trusts either of them. -- P. J. O'Rourke --------------------------------------------------------------------- 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.
