{"record":{"id":"931bbf71ea0a9175","repo":"puppetlabs/puppet","slug":"instance-class-name-msg","errorCode":null,"errorMessage":"'#{instance.class.name}' #{msg}","messagePattern":"'#\\{instance\\.class\\.name\\}' #\\{msg\\}","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/puppet/pops/functions/dispatcher.rb","lineNumber":44,"sourceCode":"  end\n\n  # Dispatches the call to the first found signature (entry with matching type).\n  #\n  # @param instance [Puppet::Functions::Function] - the function to call\n  # @param calling_scope [T.B.D::Scope] - the scope of the caller\n  # @param args [Array<Object>] - the given arguments in the form of an Array\n  # @return [Object] - what the called function produced\n  #\n  # @api private\n  def dispatch(instance, calling_scope, args, &block)\n    dispatcher = find_matching_dispatcher(args, &block)\n    unless dispatcher\n      args_type = Puppet::Pops::Types::TypeCalculator.singleton.infer_set(block_given? ? args + [block] : args)\n      raise ArgumentError, Puppet::Pops::Types::TypeMismatchDescriber.describe_signatures(instance.class.name, signatures, args_type)\n    end\n    if dispatcher.argument_mismatch_handler?\n      msg = dispatcher.invoke(instance, calling_scope, args)\n      raise ArgumentError, \"'#{instance.class.name}' #{msg}\"\n    end\n\n    catch(:next) do\n      dispatcher.invoke(instance, calling_scope, args, &block)\n    end\n  end\n\n  # Adds a dispatch directly to the set of dispatchers.\n  # @api private\n  def add(a_dispatch)\n    @dispatchers << a_dispatch\n  end\n\n  # Produces a CallableType for a single signature, and a Variant[<callables>] otherwise\n  #\n  # @api private\n  def to_type\n    # make a copy to make sure it can be contained by someone else (even if it is not contained here, it","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/functions/dispatcher.rb#L26-L62","documentation":"Error \"'#{instance.class.name}' #{msg}\" thrown in puppetlabs/puppet.","triggerScenarios":"Thrown at lib/puppet/pops/functions/dispatcher.rb:44 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-22T04:17:13.399Z"}