lib/bolt/pal/yaml_plan/transpiler.rb in bolt-2.40.2 vs lib/bolt/pal/yaml_plan/transpiler.rb in bolt-2.42.0

- old
+ new

@@ -62,10 +62,14 @@ rescue Errno::ENOENT msg = "Could not read yaml plan file: #{@plan_path}" raise Bolt::FileError.new(msg, @plan_path) end - Bolt::PAL::YamlPlan::Loader.from_string(@modulename, file_contents, @plan_path) + begin + Bolt::PAL::YamlPlan::Loader.from_string(@modulename, file_contents, @plan_path) + rescue Puppet::PreformattedError, StandardError => e + raise PALError.from_preformatted_error(e) + end end def validate_path unless File.extname(@filename) == ".yaml" raise ConvertError.new("You can only convert plans written in yaml", @plan_path)