Exception: LiveQA::RequestError
- Inherits:
-
StandardError
- Object
- StandardError
- LiveQA::RequestError
- Defined in:
- lib/liveqa/errors.rb,
lib/liveqa/errors.rb
Overview
Request to API Error
Instance Attribute Summary collapse
-
#http_body ⇒ Object
readonly
Returns the value of attribute http_body.
-
#http_message ⇒ Object
readonly
Returns the value of attribute http_message.
-
#http_status ⇒ Object
readonly
Returns the value of attribute http_status.
-
#http_status_type ⇒ Object
readonly
Returns the value of attribute http_status_type.
Instance Method Summary collapse
-
#initialize(response, message: nil) ⇒ RequestError
constructor
A new instance of RequestError.
- #to_s ⇒ Object
Constructor Details
#initialize(response, message: nil) ⇒ RequestError
Returns a new instance of RequestError.
28 29 30 31 32 33 |
# File 'lib/liveqa/errors.rb', line 28 def initialize(response, message: nil) @http_status = response.code.to_i @http_status_type = response.code_type @http_body = response.body @http_message = || response. end |
Instance Attribute Details
#http_body ⇒ Object (readonly)
Returns the value of attribute http_body.
23 24 25 |
# File 'lib/liveqa/errors.rb', line 23 def http_body @http_body end |
#http_message ⇒ Object (readonly)
Returns the value of attribute http_message.
26 27 28 |
# File 'lib/liveqa/errors.rb', line 26 def @http_message end |
#http_status ⇒ Object (readonly)
Returns the value of attribute http_status.
24 25 26 |
# File 'lib/liveqa/errors.rb', line 24 def http_status @http_status end |
#http_status_type ⇒ Object (readonly)
Returns the value of attribute http_status_type.
25 26 27 |
# File 'lib/liveqa/errors.rb', line 25 def http_status_type @http_status_type end |
Instance Method Details
#to_s ⇒ Object
35 36 37 |
# File 'lib/liveqa/errors.rb', line 35 def to_s "Status #{http_status}: #{}" end |