Exception: AWS::Errors::Base
- Inherits:
-
StandardError
- Object
- StandardError
- AWS::Errors::Base
- Defined in:
- lib/aws/errors.rb
Overview
Base class for all errors returned by the service.
Direct Known Subclasses
S3::Errors::IncorrectClientSideEncryptionKey, S3::Errors::NoSuchKey, S3::Errors::NotModified
Instance Attribute Summary collapse
-
#code ⇒ String
readonly
The response code given by the service.
-
#http_request ⇒ Http::Request
readonly
The low level http request that caused the error to be raised.
-
#http_response ⇒ Http::Response
readonly
The low level http response from the service that wrapped the service error.
Instance Method Summary collapse
-
#initialize(req = nil, resp = nil, code = nil, message = nil) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#new(error_message) ⇒ Base #new(http_request, http_response, code = nil, message = nil) ⇒ Base
Returns a new instance of Base.
52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/aws/errors.rb', line 52 def initialize req = nil, resp = nil, code = nil, = nil if req.is_a?(String) or req.nil? super(req) else @http_request = req @http_response = resp @code = code include_error_type super( || http_response.body) end end |
Instance Attribute Details
#code ⇒ String (readonly)
Returns The response code given by the service.
65 66 67 |
# File 'lib/aws/errors.rb', line 65 def code @code end |
#http_request ⇒ Http::Request (readonly)
Returns The low level http request that caused the error to be raised.
69 70 71 |
# File 'lib/aws/errors.rb', line 69 def http_request @http_request end |
#http_response ⇒ Http::Response (readonly)
Returns The low level http response from the service that wrapped the service error.
73 74 75 |
# File 'lib/aws/errors.rb', line 73 def http_response @http_response end |