Exception: QcloudVod::RequestError

Inherits:
Error
  • Object
show all
Defined in:
lib/qcloud_vod/error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ RequestError

Returns a new instance of RequestError.



9
10
11
12
13
14
15
16
# File 'lib/qcloud_vod/error.rb', line 9

def initialize(response)
  if response.parsed_response.key?('Code')
    @code = response.parsed_response['Code']
    @message = response.parsed_response['Message']
  end
  @origin_response = response
  super("API ERROR Code=#{@code}, Message=#{@message}")
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



5
6
7
# File 'lib/qcloud_vod/error.rb', line 5

def code
  @code
end

#messageObject (readonly)

Returns the value of attribute message.



6
7
8
# File 'lib/qcloud_vod/error.rb', line 6

def message
  @message
end

#origin_responseObject (readonly)

Returns the value of attribute origin_response.



7
8
9
# File 'lib/qcloud_vod/error.rb', line 7

def origin_response
  @origin_response
end