Module: Stackup::ErrorHandling
Overview
Handle Aws::CloudFormation::Errors::ValidationError
.
Instance Method Summary collapse
-
#handling_cf_errors ⇒ Object
Invoke an Aws::CloudFormation operation.
Instance Method Details
#handling_cf_errors ⇒ Object
Invoke an Aws::CloudFormation operation.
If an exception is raised, convert it to a Stackup exception, if appropriate.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/stackup/error_handling.rb', line 16 def handling_cf_errors yield rescue Aws::CloudFormation::Errors::ChangeSetNotFound => _e raise NoSuchChangeSet, "no such change-set" rescue Aws::CloudFormation::Errors::ValidationError => e case e. when /Stack .* does not exist/ raise NoSuchStack, "no such stack" when "No updates are to be performed." raise NoUpdateRequired, "no updates are required" when / can ?not be / raise InvalidStateError, e. else raise ValidationError, e. end end |