# File lib/puppet-syntax/templates.rb, line 46
    def validate_erb(filename)
      errors = []

      begin
        erb = ERB.new(File.read(filename), nil, '-')
        erb.filename = filename
        erb.result
      rescue NameError => error
        # This is normal because we don't have the variables that would
        # ordinarily be bound by the parent Puppet manifest.
      rescue TypeError
        # This is normal because we don't have the variables that would
        # ordinarily be bound by the parent Puppet manifest.
      rescue SyntaxError => error
        errors << error
      end

      errors
    end