class
AWS::S3::Exception
- AWS::S3::Exception
- AWS::Exception
- Exception
- Reference
- Object
Direct Known Subclasses
- AWS::S3::InvalidXML
- AWS::S3::UnexpectedResponse
- AWS::S3::UnknownBucket
- AWS::S3::UnknownObject
- AWS::S3::XMLIsNotABucket
Defined in:
s3.crConstructors
-
.from_response(status : HTTP::Status, body : String, *, bucket_name : String | Nil = nil, key : String | Nil = nil) : self
Builds the most specific exception we can from an S3 error response.
- .new(message : String | Nil = nil, *, status : HTTP::Status | Nil = nil, code : Nil | String = nil, request_id : Nil | String = nil)
Instance Method Summary
Constructor Detail
def self.from_response(status : HTTP::Status, body : String, *, bucket_name : String | Nil = nil, key : String | Nil = nil) : self
#
Builds the most specific exception we can from an S3 error response. S3 error bodies look like:
<Error>
<Code>NoSuchKey</Code>
<Message>The specified key does not exist.</Message>
<Key>foo</Key>
<RequestId>...</RequestId>
</Error>
HEAD responses and some proxies return no body, so we fall back to the HTTP status alone.
def self.new(message : String | Nil = nil, *, status : HTTP::Status | Nil = nil, code : Nil | String = nil, request_id : Nil | String = nil)
#