lib/puppet/error.rb
# 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.
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.
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 .
def to_s
      msg = super
      if @file and @line and @pos
        "#{msg} at #{@file}:#{@line}:#{@pos}"
      elsif @file and @line
        "#{msg} at #{@file}:#{@line}"
      elsif @line and @pos
          "#{msg} at line #{@line}:#{@pos}"
      elsif @line
        "#{msg} at line #{@line}"
      elsif @file
        "#{msg} in #{@file}"
      else
        msg
      end
    end
def to_s msg = super if @file and @line and @pos "#{msg} at #{@file}:#{@line}:#{@pos}" elsif @file and @line "#{msg} at #{@file}:#{@line}" elsif @line and @pos "#{msg} at line #{@line}:#{@pos}" elsif @line "#{msg} at line #{@line}" elsif @file "#{msg} in #{@file}" else msg end end
This module implements logging with a filename and line number.
This module implements logging with a filename and line number .