Class: Amazon::AWS::Error::AWSError
- Inherits:
-
Object
- Object
- Amazon::AWS::Error::AWSError
- Defined in:
- lib/amazon/aws.rb
Overview
An exception generator class.
Instance Attribute Summary collapse
-
#exception ⇒ Object
readonly
Returns the value of attribute exception.
Instance Method Summary collapse
-
#initialize(xml) ⇒ AWSError
constructor
A new instance of AWSError.
Constructor Details
#initialize(xml) ⇒ AWSError
Returns a new instance of AWSError.
1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 |
# File 'lib/amazon/aws.rb', line 1156 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 |
Instance Attribute Details
#exception ⇒ Object (readonly)
Returns the value of attribute exception.
1154 1155 1156 |
# File 'lib/amazon/aws.rb', line 1154 def exception @exception end |