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.
30 31 32 33 34 |
# File 'lib/incognia_api.rb', line 30 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.
28 29 30 |
# File 'lib/incognia_api.rb', line 28 def errors @errors end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
28 29 30 |
# File 'lib/incognia_api.rb', line 28 def @message end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
28 29 30 |
# File 'lib/incognia_api.rb', line 28 def status @status end |
Instance Method Details
#format_message(initial_message) ⇒ Object
40 41 42 43 |
# File 'lib/incognia_api.rb', line 40 def () = "[HTTP #{status}]: #{}" += "\n#{errors}" if errors end |
#to_s ⇒ Object
36 37 38 |
# File 'lib/incognia_api.rb', line 36 def to_s end |