module Puppet::ExternalFileError
Attributes
file[RW]
This module implements logging with a filename and line number. Use this for errors that need to report a location in a non-ruby file that we parse.
line[RW]
This module implements logging with a filename and line number. Use this for errors that need to report a location in a non-ruby file that we parse.
pos[RW]
This module implements logging with a filename and line number. Use this for errors that need to report a location in a non-ruby file that we parse.
puppetstack[RW]
This module implements logging with a filename and line number. Use this for errors that need to report a location in a non-ruby file that we parse.
Public Class Methods
new(message, file=nil, line=nil, pos=nil, original=nil)
click to toggle source
May be called with 3 arguments for message, file, line, and exception, or 4 args including the position on the line.
Calls superclass method
# File lib/puppet/error.rb 21 def initialize(message, file=nil, line=nil, pos=nil, original=nil) 22 if pos.kind_of? Exception 23 original = pos 24 pos = nil 25 end 26 27 super(message, original) 28 29 @file = file unless (file.is_a?(String) && file.empty?) 30 @line = line 31 @pos = pos 32 33 if original && original.respond_to?(:puppetstack) 34 @puppetstack = original.puppetstack 35 else 36 @puppetstack = Puppet::Pops::PuppetStack.stacktrace() 37 end 38 end
Public Instance Methods
to_s()
click to toggle source
Calls superclass method
# File lib/puppet/error.rb 40 def to_s 41 msg = super 42 @file = nil if (@file.is_a?(String) && @file.empty?) 43 msg += Puppet::Util::Errors.error_location_with_space(@file, @line, @pos) 44 msg 45 end