Exception: Aliyun::OSS::ResponseError

Inherits:
OSSException show all
Defined in:
lib/aliyun/oss/exceptions.rb

Overview

All responses with a code between 300 and 599 that contain an <Error></Error> body are wrapped in an ErrorResponse which contains an Error object. This Error class generates a custom exception with the name of the xml Error and its message. All such runtime generated exception classes descend from ResponseError and contain the ErrorResponse object so that all code that makes a request can rescue ResponseError and get access to the ErrorResponse.

Direct Known Subclasses

InternalError, NoSuchKey, RequestTimeout

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, response) ⇒ ResponseError

Returns a new instance of ResponseError.



16
17
18
19
# File 'lib/aliyun/oss/exceptions.rb', line 16

def initialize(message, response)
  @response = response
  super(message)
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



15
16
17
# File 'lib/aliyun/oss/exceptions.rb', line 15

def response
  @response
end