{"record":{"id":"42ca6765c84ed0be","repo":"puppetlabs/puppet","slug":"subject-errors-str","errorCode":null,"errorMessage":"#{subject}:\n #{errors_str}","messagePattern":"#\\{subject\\}:\n #\\{errors_str\\}","errorType":"exception","errorClass":"Puppet::ParseError","httpStatus":null,"severity":"error","filePath":"lib/puppet/pops/types/type_mismatch_describer.rb","lineNumber":539,"sourceCode":"    # with the corresponding param_struct element and that all required values are provided.\n    #\n    # @param subject [String] string to be prepended to the exception message\n    # @param params_struct [PStructType] Struct to use for validation\n    # @param given_hash [Hash<String,Object>] the parameters to validate\n    # @param missing_ok [Boolean] Do not generate errors on missing parameters\n    # @param tense [Symbol] deprecated and ignored\n    #\n    def validate_parameters(subject, params_struct, given_hash, missing_ok = false, tense = :ignored)\n      tense_deprecated unless tense == :ignored\n      errors = describe_struct_signature(params_struct, given_hash, missing_ok).flatten\n      case errors.size\n      when 0\n        # do nothing\n      when 1\n        raise Puppet::ParseError, \"#{subject}:#{errors[0].format}\"\n      else\n        errors_str = errors.map(&:format).join(\"\\n \")\n        raise Puppet::ParseError, \"#{subject}:\\n #{errors_str}\"\n      end\n    end\n\n    # Describe a confirmed mismatch using present tense\n    #\n    # @param name [String] name of mismatch\n    # @param expected [PAnyType] expected type\n    # @param actual [PAnyType] actual type\n    # @param tense [Symbol] deprecated and ignored\n    #\n    def describe_mismatch(name, expected, actual, tense = :ignored)\n      tense_deprecated unless tense == :ignored\n      errors = describe(expected, actual, [SubjectPathElement.new(name)])\n      case errors.size\n      when 0\n        ''\n      when 1\n        errors[0].format.strip","sourceCodeStart":521,"sourceCodeEnd":557,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/types/type_mismatch_describer.rb#L521-L557","documentation":"Error \"#{subject}:\n #{errors_str}\" thrown in puppetlabs/puppet.","triggerScenarios":"Thrown at lib/puppet/pops/types/type_mismatch_describer.rb:539 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"}