Skip to content

Commit

Permalink
(PDK-459) Improve error message when the generation target exists
Browse files Browse the repository at this point in the history
```
foo$ ~/git/pdk/bin/pdk new def bar
pdk (FATAL): Unable to generate defined_type; '/home/david/git/pdk/foo/manifests/bar.pp' already exists.
foo$ ~/git/pdk/bin/pdk new class bar
pdk (FATAL): Unable to generate class; '/home/david/git/pdk/foo/manifests/bar.pp' already exists.
foo$
```
  • Loading branch information
DavidS committed Sep 5, 2017
1 parent 1d6e2bc commit d4f402a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/pdk/generators/puppet_object.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def object_type
def run
[target_object_path, target_spec_path].each do |target_file|
if File.exist?(target_file)
raise PDK::CLI::FatalError, _("Unable to generate class; '%{file}' already exists.") % { file: target_file }
raise PDK::CLI::FatalError, _("Unable to generate %{object_type}; '%{file}' already exists.") % { file: target_file, object_type: object_type }
end
end

Expand Down

0 comments on commit d4f402a

Please sign in to comment.