Exception: ABBYY::Cloud::ResponseError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/abbyy/cloud/exceptions/response_error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ ResponseError

Returns a new instance of ResponseError.



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/abbyy/cloud/exceptions/response_error.rb', line 7

def initialize(response)
  @data   = Models::Error[parse_response(response)]
  @status = response.code.to_i

  super <<-MESSAGE.gsub(/ +\|/, "")
    |ABBYY Cloud API responded to the request #{data.request_id} with a status #{status}
    |  error:       #{data.error}
    |  description: #{data.error_description}
    |  model_state: #{data.model_state}
  MESSAGE
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



5
6
7
# File 'lib/abbyy/cloud/exceptions/response_error.rb', line 5

def data
  @data
end

#statusObject (readonly)

Returns the value of attribute status.



5
6
7
# File 'lib/abbyy/cloud/exceptions/response_error.rb', line 5

def status
  @status
end