class AWS::S3::Exception

Direct Known Subclasses

Defined in:

s3.cr

Constructors

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.


[View source]
def self.new(message : String | Nil = nil, *, status : HTTP::Status | Nil = nil, code : Nil | String = nil, request_id : Nil | String = nil) #

[View source]

Instance Method Detail

def code : String | Nil #

[View source]
def request_id : String | Nil #

[View source]
def status : HTTP::Status | Nil #

[View source]