Module Amazon::AWS::Error
In: lib/amazon/aws.rb

All dynamically generated exceptions occur within this namespace.

Methods

exception  

Classes and Modules

Class Amazon::AWS::Error::AWSError

Public Class methods

[Source]

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

        # Dynamically define a new exception class for this class of error,
        # unless it already exists.
        #
        unless Amazon::AWS::Error.const_defined?( err_class )
          Amazon::AWS::Error.const_set( err_class, Class.new( AWSError ) )
        end

        # Generate and return a new exception from the relevant class.
        #
        Amazon::AWS::Error.const_get( err_class ).new( err_msg )
      end

[Validate]