Class Amazon::AWS::Error::AWSError
In: lib/amazon/aws.rb
Parent: Object

An exception generator class.

Methods

new  

Attributes

exception  [R] 

Public Class methods

[Source]

# File lib/amazon/aws.rb, line 1137
        def initialize(xml)
          err_class = xml.elements['Code'].text.sub( /^AWS.*\./, '' )
          err_msg = xml.elements['Message'].text

          unless Amazon::AWS::Error.const_defined?( err_class )
            Amazon::AWS::Error.const_set( err_class,
                                          Class.new( StandardError ) )
          end

          ex_class = Amazon::AWS::Error.const_get( err_class )
          @exception = ex_class.new( err_msg )
        end

[Validate]