Exception: S3Lib::S3ResponseError
- Inherits:
-
StandardError
- Object
- StandardError
- S3Lib::S3ResponseError
- Defined in:
- lib/s3_errors.rb
Direct Known Subclasses
BucketNotEmptyError, BucketNotFoundError, MalformedACLError, NoContentError, NotYourBucketError
Instance Attribute Summary collapse
-
#amazon_error_type ⇒ Object
readonly
Returns the value of attribute amazon_error_type.
-
#io ⇒ Object
readonly
Returns the value of attribute io.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
-
#s3requester ⇒ Object
readonly
Returns the value of attribute s3requester.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(message, io, s3requester) ⇒ S3ResponseError
constructor
A new instance of S3ResponseError.
Constructor Details
#initialize(message, io, s3requester) ⇒ S3ResponseError
Returns a new instance of S3ResponseError.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/s3_errors.rb', line 6 def initialize(, io, s3requester) @io = io # Get the response and status from the IO object @io.rewind @response = @io.read @io.rewind @status = io.status # The Amazon Error type will always look like <Code>AmazonErrorType</Code>. Find it with a RegExp. @response =~ /<Code>(.*)<\/Code>/ @amazon_error_type = $1 # Make the AuthenticatedRequest instance available as well @s3requester = s3requester # Call the standard Error initializer # if you put '%s' in the message it will be replaced by the amazon_error_type += "\namazon error type: %s" unless =~ /\%s/ super( % @amazon_error_type) end |
Instance Attribute Details
#amazon_error_type ⇒ Object (readonly)
Returns the value of attribute amazon_error_type.
5 6 7 |
# File 'lib/s3_errors.rb', line 5 def amazon_error_type @amazon_error_type end |
#io ⇒ Object (readonly)
Returns the value of attribute io.
5 6 7 |
# File 'lib/s3_errors.rb', line 5 def io @io end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
5 6 7 |
# File 'lib/s3_errors.rb', line 5 def response @response end |
#s3requester ⇒ Object (readonly)
Returns the value of attribute s3requester.
5 6 7 |
# File 'lib/s3_errors.rb', line 5 def s3requester @s3requester end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
5 6 7 |
# File 'lib/s3_errors.rb', line 5 def status @status end |