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 20 def initialize(message, file=nil, line=nil, pos=nil, original=nil) 21 if pos.kind_of? Exception 22 original = pos 23 pos = nil 24 end 25 26 super(message, original) 27 28 @file = file unless (file.is_a?(String) && file.empty?) 29 @line = line 30 @pos = pos 31 32 if original && original.respond_to?(:puppetstack) 33 @puppetstack = original.puppetstack 34 else 35 @puppetstack = Puppet::Pops::PuppetStack.stacktrace() 36 end 37 end
Public Instance Methods
to_s()
click to toggle source
Calls superclass method
# File lib/puppet/error.rb 39 def to_s 40 msg = super 41 @file = nil if (@file.is_a?(String) && @file.empty?) 42 msg += Puppet::Util::Errors.error_location_with_space(@file, @line, @pos) 43 msg 44 end