Puppet Version: Puppet 6.10.2 Puppet Server Version: 2019.2.2 OS Name/Version: Ubuntu 16.04 Actual Behavior: When setting up a deferred function if a difference number of arguments are passed into the dispatch declaration versus the actual method a Puppet run will generate the following error: "Error: Failed to apply catalog: wrong number of arguments (given 2, expected 1)" The issue is that none of the file / line number information is returned as part of the error message above, offering no trace back to the origination of the error in the code base. Code example:
dispatch :example do |
param 'String', :stuff |
optional_param 'String', :morestuff |
end |
def example(stuff) |
return stuff + 1 |
end
|
When the same code is ran and it is not a Deferred function, a file / line number is included in that error message. Desired behavior: Generate an error message with a line / file indication: "Error: Failed tp apply catalog, wrong number of arguments (given 2, expected 1) (file: /home/test_user/Working/custom_function_repro/modules/test_module/manifests/init.pp, line: 2, column: 8)" |