{"record":{"id":"cf191cf84eb2306a","repo":"puppetlabs/puppet","slug":"function-name-the-template-args-must-be-a-ha","errorCode":null,"errorMessage":"%{function_name}(): the template_args must be a Hash, got a %{class_name}","messagePattern":"%(.+?)\\(\\): the template_args must be a Hash, got a %(.+?)","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/puppet/pops/evaluator/epp_evaluator.rb","lineNumber":114,"sourceCode":"\n    # inline_epp() logic sees all local variables, epp() all global\n    if use_global_scope_only\n      scope.with_global_scope do |global_scope|\n        parser.closure(body, global_scope).call_by_name(template_args, enforce_parameters)\n      end\n    else\n      parser.closure(body, scope).call_by_name(template_args, enforce_parameters)\n    end\n  end\n  private_class_method :evaluate\n\n  def self.handle_template_args(func_name, template_args)\n    if template_args.nil?\n      [{}, false]\n    else\n      unless template_args.is_a?(Hash)\n        # TRANSLATORS 'template_args' is a variable name and should not be translated\n        raise ArgumentError, _(\"%{function_name}(): the template_args must be a Hash, got a %{class_name}\") %\n                             { function_name: func_name, class_name: template_args.class }\n      end\n      [template_args, true]\n    end\n  end\n  private_class_method :handle_template_args\nend\n","sourceCodeStart":96,"sourceCodeEnd":122,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/evaluator/epp_evaluator.rb#L96-L122","documentation":"Error \"%{function_name}(): the template_args must be a Hash, got a %{class_name}\" thrown in puppetlabs/puppet.","triggerScenarios":"Thrown at lib/puppet/pops/evaluator/epp_evaluator.rb:114 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}