Exception: Incognia::APIError
- Inherits:
-
StandardError
- Object
- StandardError
- Incognia::APIError
- Defined in:
- lib/incognia_api.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
- #format_message(initial_message) ⇒ Object
-
#initialize(message, response_info = {}) ⇒ APIError
constructor
A new instance of APIError.
- #to_s ⇒ Object
Constructor Details
#initialize(message, response_info = {}) ⇒ APIError
Returns a new instance of APIError.
21 22 23 24 25 |
# File 'lib/incognia_api.rb', line 21 def initialize(, response_info = {}) @status = response_info[:status] @errors = response_info[:body] @message = () end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
19 20 21 |
# File 'lib/incognia_api.rb', line 19 def errors @errors end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
19 20 21 |
# File 'lib/incognia_api.rb', line 19 def @message end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
19 20 21 |
# File 'lib/incognia_api.rb', line 19 def status @status end |
Instance Method Details
#format_message(initial_message) ⇒ Object
31 32 33 34 |
# File 'lib/incognia_api.rb', line 31 def () = "[HTTP #{status}]: #{}" += "\n#{errors}" if errors end |
#to_s ⇒ Object
27 28 29 |
# File 'lib/incognia_api.rb', line 27 def to_s end |