lib/puppet/util/errors.rb
# Add line and file info to the supplied exception if info is available from
# this object, is appropriately populated and the supplied exception supports
# it.  When other is supplied, the backtrace will be copied to the error
# object.
#
# @param error [Exception] exception that is populated with info
# @param other [Exception] original exception, source of backtrace info
# @return [Exception] error parameter
Add line and file info to the supplied exception if info is available from
this object, is appropriately populated and the supplied exception supports
it.  When other is supplied, the backtrace will be copied to the error
object.
Add line and file info to the supplied exception if info is available from this object is appropriately populated and the supplied exception supports it . When other is supplied the backtrace will be copied to the error object .
def adderrorcontext(error, other = nil)
    error.line ||= self.line if error.respond_to?(:line=) and self.respond_to?(:line) and self.line
    error.file ||= self.file if error.respond_to?(:file=) and self.respond_to?(:file) and self.file
    error.set_backtrace(other.backtrace) if other and other.respond_to?(:backtrace)
    error
  end
def adderrorcontext ( error , other = nil ) error . line ||= self . line if error . respond_to? ( :line= ) and self . respond_to? ( :line ) and self . line error . file ||= self . file if error . respond_to? ( :file= ) and self . respond_to? ( :file ) and self . file error . set_backtrace ( other . backtrace ) if other and other . respond_to? ( :backtrace ) error end
Add line and file info to the supplied exception if info is available from
this object, is appropriately populated and the supplied exception supports
it.
Add line and file info to the supplied exception if info is available from this object is appropriately populated and the supplied exception supports it .
None
Exception
error
exception that is populated with info
exception that is populated with info
other
original exception, source of backtrace info
original exception source of backtrace info