Sha256: 3d82c1eaee7fb5f25b852685ce578ddc249b3b35c458d1ef844e52dde21056ee

Contents?: true

Size: 777 Bytes

Versions: 3

Compression:

Stored size: 777 Bytes

Contents

require 'xmlsimple'

module SimpleDeploy
  class AWS
    class CloudFormation
      class Error

        def initialize(args)
          @logger    = SimpleDeploy.logger
          @exception = args[:exception]
        end

        def process
          message = XmlSimple.xml_in @exception.response.body
          message['Error'].first['Message'].each do |msg|
            case msg
            when 'No updates are to be performed.'
              @logger.info msg
            when /^Stack:(.*) does not exist$/
              @logger.error msg
              raise Exceptions::UnknownStack.new msg
            else
              @logger.error msg
              raise Exceptions::CloudFormationError.new msg
            end
          end
        end

      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
simple_deploy-0.7.5 lib/simple_deploy/aws/cloud_formation/error.rb
simple_deploy-0.7.4 lib/simple_deploy/aws/cloud_formation/error.rb
simple_deploy-0.7.3 lib/simple_deploy/aws/cloud_formation/error.rb