Method: Puppet::Util::Errors.error_location_with_space

Defined in:
lib/puppet/util/errors.rb

.error_location_with_space(file, line = nil, column = nil) ⇒ String

Return a human-readable string of this object’s file, line, and pos attributes, with a proceeding space in the output if set.

Parameters:

  • file (String)

    the file path for the error (nil or “”, for not known)

  • line (String) (defaults to: nil)

    the line number for the error (nil or “”, for not known)

  • column (String) (defaults to: nil)

    the column number for the error (nil or “”, for not known)

Returns:

  • (String)

    description of file, line, and column



70
71
72
73
74
75
76
77
# File 'lib/puppet/util/errors.rb', line 70

def self.error_location_with_space(file, line=nil, column=nil)
  error_location_str = error_location(file, line, column)
  if error_location_str.empty?
    ''
  else
    ' ' + error_location_str
  end
end