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.
# File lib/puppet/error.rb, line 17 def initialize(message, file=nil, line=nil, original=nil) super(message, original) @file = file @line = line end
# File lib/puppet/error.rb, line 23 def to_s msg = super if @file and @line "#{msg} at #{@file}:#{@line}" elsif @line "#{msg} at line #{@line}" elsif @file "#{msg} in #{@file}" else msg end end