Class: Aptible::Resource::Errors
- Inherits:
-
Object
- Object
- Aptible::Resource::Errors
- Defined in:
- lib/aptible/resource/errors.rb
Instance Attribute Summary collapse
-
#full_messages ⇒ Object
rubocop:disable DuplicateMethods.
-
#messages ⇒ Object
rubocop:disable DuplicateMethods.
-
#status_code ⇒ Object
rubocop:disable DuplicateMethods.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#full_messages ⇒ Object
rubocop:disable DuplicateMethods
5 6 7 |
# File 'lib/aptible/resource/errors.rb', line 5 def @full_messages end |
#messages ⇒ Object
rubocop:disable DuplicateMethods
5 6 7 |
# File 'lib/aptible/resource/errors.rb', line 5 def @messages end |
#status_code ⇒ Object
rubocop:disable DuplicateMethods
5 6 7 |
# File 'lib/aptible/resource/errors.rb', line 5 def status_code @status_code end |
Class Method Details
.from_exception(exception) ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/aptible/resource/errors.rb', line 7 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 |