Exception: Rasti::AI::Errors::RequestFail
- Inherits:
-
StandardError
- Object
- StandardError
- Rasti::AI::Errors::RequestFail
- Defined in:
- lib/rasti/ai/errors.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(url, body, response) ⇒ RequestFail
constructor
A new instance of RequestFail.
- #message ⇒ Object
Constructor Details
#initialize(url, body, response) ⇒ RequestFail
Returns a new instance of RequestFail.
9 10 11 12 13 |
# File 'lib/rasti/ai/errors.rb', line 9 def initialize(url, body, response) @url = url @body = body @response = response end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
7 8 9 |
# File 'lib/rasti/ai/errors.rb', line 7 def body @body end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
7 8 9 |
# File 'lib/rasti/ai/errors.rb', line 7 def response @response end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
7 8 9 |
# File 'lib/rasti/ai/errors.rb', line 7 def url @url end |
Instance Method Details
#message ⇒ Object
15 16 17 |
# File 'lib/rasti/ai/errors.rb', line 15 def "Request fail\nRequest: #{url}\n#{JSON.pretty_generate(body)}\nResponse: #{response.code}\n#{response.body}" end |