Skip to content

Commit

Permalink
Merge pull request #547 from nikhil2611/ng/improve_error_message
Browse files Browse the repository at this point in the history
updated the error messages on bogus ami_id
  • Loading branch information
tas50 committed Jul 2, 2021
2 parents d02803e + ccc367b commit 72c2fc6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/kitchen/driver/ec2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -264,11 +264,11 @@ def create(state)
attach_network_interface(state) unless config[:elastic_network_interface_id].nil?
create_ec2_json(state) if /chef/i.match?(instance.provisioner.name)
debug("ec2:create '#{state[:hostname]}'")
rescue Exception
rescue Exception => e
# Clean up any auto-created security groups or keys on the way out.
delete_security_group(state)
delete_key(state)
raise
raise "#{e.message} in the specified region #{config[:region]}. Please check this AMI is available in this region."
end

def destroy(state)
Expand Down

0 comments on commit 72c2fc6

Please # to comment.