Exception: Aliyun::Oss::RequestError
- Defined in:
- lib/aliyun/oss/error.rb
Overview
- Aliyun::Oss::RequestError
-
when OSS give a Non 2xx response
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Error Code defined by OSS.
-
#message ⇒ Object
readonly
Error Message defined by OSS.
-
#origin_response ⇒ Object
readonly
The Origin Httparty Response.
-
#request_id ⇒ Object
readonly
It’s the UUID to uniquely identifies this request; When you can’t solve the problem, you can request help from the OSS development engineer with the RequestId.
Instance Method Summary collapse
-
#initialize(response) ⇒ RequestError
constructor
A new instance of RequestError.
Constructor Details
#initialize(response) ⇒ RequestError
Returns a new instance of RequestError.
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/aliyun/oss/error.rb', line 20 def initialize(response) if (error_values = response.parsed_response['Error']).empty? @code = response.code @message = response. else @code = error_values['Code'] @message = error_values['Message'] end @request_id = response.headers['x-oss-request-id'] @origin_response = response super("#{@request_id} - #{@code}: #{@message}") end |
Instance Attribute Details
#code ⇒ Object (readonly)
Error Code defined by OSS
8 9 10 |
# File 'lib/aliyun/oss/error.rb', line 8 def code @code end |
#message ⇒ Object (readonly)
Error Message defined by OSS
11 12 13 |
# File 'lib/aliyun/oss/error.rb', line 11 def @message end |
#origin_response ⇒ Object (readonly)
The Origin Httparty Response
18 19 20 |
# File 'lib/aliyun/oss/error.rb', line 18 def origin_response @origin_response end |
#request_id ⇒ Object (readonly)
It’s the UUID to uniquely identifies this request; When you can’t solve the problem, you can request help from the OSS development engineer with the RequestId.
15 16 17 |
# File 'lib/aliyun/oss/error.rb', line 15 def request_id @request_id end |