{"record":{"id":"07a9a8e170d2db36","repo":"puppetlabs/puppet","slug":"subject-errors-0-format","errorCode":null,"errorMessage":"#{subject}:#{errors[0].format}","messagePattern":"#\\{subject\\}:#\\{errors\\[0\\]\\.format\\}","errorType":"exception","errorClass":"Puppet::ParseError","httpStatus":null,"severity":"error","filePath":"lib/puppet/pops/types/type_mismatch_describer.rb","lineNumber":536,"sourceCode":"    end\n\n    # Validates that all entries in the give_hash exists in the given param_struct, that their type conforms\n    # 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","sourceCodeStart":518,"sourceCodeEnd":554,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/types/type_mismatch_describer.rb#L518-L554","documentation":"Error \"#{subject}:#{errors[0].format}\" thrown in puppetlabs/puppet.","triggerScenarios":"Thrown at lib/puppet/pops/types/type_mismatch_describer.rb:536 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"}