Exception: ABBYY::Cloud::ResponseError
- Inherits:
-
StandardError
- Object
- StandardError
- ABBYY::Cloud::ResponseError
- Defined in:
- lib/abbyy/cloud/exceptions/response_error.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(response) ⇒ ResponseError
constructor
A new instance of ResponseError.
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
#data ⇒ Object (readonly)
Returns the value of attribute data.
5 6 7 |
# File 'lib/abbyy/cloud/exceptions/response_error.rb', line 5 def data @data end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
5 6 7 |
# File 'lib/abbyy/cloud/exceptions/response_error.rb', line 5 def status @status end |