Class: Aptible::Resource::Errors
- Inherits:
-
Object
- Object
- Aptible::Resource::Errors
- Defined in:
- lib/aptible/resource/errors.rb
Instance Attribute Summary collapse
-
#full_messages ⇒ Object
Returns the value of attribute full_messages.
-
#messages ⇒ Object
Returns the value of attribute messages.
-
#status_code ⇒ Object
Returns the value of attribute status_code.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#full_messages ⇒ Object
Returns the value of attribute full_messages.
4 5 6 |
# File 'lib/aptible/resource/errors.rb', line 4 def @full_messages end |
#messages ⇒ Object
Returns the value of attribute messages.
4 5 6 |
# File 'lib/aptible/resource/errors.rb', line 4 def @messages end |
#status_code ⇒ Object
Returns the value of attribute status_code.
4 5 6 |
# File 'lib/aptible/resource/errors.rb', line 4 def status_code @status_code end |
Class Method Details
.from_exception(exception) ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/aptible/resource/errors.rb', line 6 def self.from_exception(exception) new.tap do |errors| response_json = JSON.parse(exception.response.body) errors. = { base: response_json['message'] } errors. = [response_json['message']] errors.status_code = exception.response.status end end |