Module: Stackup::ErrorHandling
- Included in:
- Stack
- Defined in:
- lib/stackup/error_handling.rb
Overview
Handle Aws::CloudFormation::Errors::ValidationError
.
Instance Method Summary collapse
-
#handling_validation_error ⇒ Object
Invoke an Aws::CloudFormation operation.
Instance Method Details
#handling_validation_error ⇒ Object
Invoke an Aws::CloudFormation operation
If a ValidationError
is raised, check the message; there’s often useful information is hidden inside. If that’s the case, convert it to an appropriate Stackup exception.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/stackup/error_handling.rb', line 15 def handling_validation_error yield 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 |