lib/bolt/task/run.rb
# TODO: we should probably use a Bolt::Task for this
we should probably use a Bolt::Task for this
we should probably use a Bolt :: Task for this
def validate_params(task_signature, params)
        task_signature.runnable_with?(params) do |mismatch_message|
          raise Bolt::ValidationError, mismatch_message
        end || (raise Bolt::ValidationError, 'Task parameters do not match')
        unless Puppet::Pops::Types::TypeFactory.data.instance?(params)
          use_args_t = Puppet::Pops::Types::TypeCalculator.infer_set(params)
          desc = Puppet::Pops::Types::TypeMismatchDescriber.singleton.describe_mismatch(
            'Task parameters are not of type Data. run_task()',
            Puppet::Pops::Types::TypeFactory.data, use_args_t
          )
          raise Bolt::ValidationError, desc
        end
        nil
      end
def validate_params ( task_signature , params ) task_signature . runnable_with? ( params ) do | mismatch_message | raise Bolt :: ValidationError , mismatch_message end || ( raise Bolt :: ValidationError , 'Task parameters do not match' ) unless Puppet :: Pops :: Types :: TypeFactory . data . instance? ( params ) use_args_t = Puppet :: Pops :: Types :: TypeCalculator . infer_set ( params ) desc = Puppet :: Pops :: Types :: TypeMismatchDescriber . singleton . describe_mismatch ( 'Task parameters are not of type Data. run_task()' , Puppet :: Pops :: Types :: TypeFactory . data , use_args_t ) raise Bolt :: ValidationError , desc end nil end
TODO: we should probably use a Bolt::Task for this
TODO : we should probably use a Bolt :: Task for this
# generate a helpful error message about the type-mismatch between the type Data # and the actual type of use_args
task_signature
<not_specific>
params
<not_specific>