Exception: Minisky::BadResponse
- Defined in:
- lib/minisky/errors.rb
Direct Known Subclasses
ClientErrorResponse, ServerErrorResponse, UnexpectedRedirect
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
- #error_message ⇒ Object
- #error_type ⇒ Object
-
#initialize(status, status_message, data) ⇒ BadResponse
constructor
A new instance of BadResponse.
Constructor Details
#initialize(status, status_message, data) ⇒ BadResponse
Returns a new instance of BadResponse.
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/minisky/errors.rb', line 16 def initialize(status, , data) @status = status @data = data = if "#{status} #{}: #{}" else "#{status} #{}" end super() end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
14 15 16 |
# File 'lib/minisky/errors.rb', line 14 def data @data end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
14 15 16 |
# File 'lib/minisky/errors.rb', line 14 def status @status end |
Instance Method Details
#error_message ⇒ Object
33 34 35 |
# File 'lib/minisky/errors.rb', line 33 def @data['message'] if @data.is_a?(Hash) end |
#error_type ⇒ Object
29 30 31 |
# File 'lib/minisky/errors.rb', line 29 def error_type @data['error'] if @data.is_a?(Hash) end |