Class: Verizon::ManagementErrorException
- Inherits:
-
APIException
- Object
- CoreLibrary::ApiException
- APIException
- Verizon::ManagementErrorException
- Defined in:
- lib/verizon/exceptions/management_error_exception.rb
Overview
management.Error class.
Instance Attribute Summary collapse
-
#cause ⇒ String
TODO: Write general description for this method.
-
#error ⇒ String
TODO: Write general description for this method.
-
#error_description ⇒ String
TODO: Write general description for this method.
Instance Method Summary collapse
-
#initialize(reason, response) ⇒ ManagementErrorException
constructor
The constructor.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
-
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash.
Constructor Details
#initialize(reason, response) ⇒ ManagementErrorException
The constructor.
27 28 29 30 31 |
# File 'lib/verizon/exceptions/management_error_exception.rb', line 27 def initialize(reason, response) super(reason, response) hash = APIHelper.json_deserialize(@response.raw_body) unbox(hash) end |
Instance Attribute Details
#cause ⇒ String
TODO: Write general description for this method
22 23 24 |
# File 'lib/verizon/exceptions/management_error_exception.rb', line 22 def cause @cause end |
#error ⇒ String
TODO: Write general description for this method
14 15 16 |
# File 'lib/verizon/exceptions/management_error_exception.rb', line 14 def error @error end |
#error_description ⇒ String
TODO: Write general description for this method
18 19 20 |
# File 'lib/verizon/exceptions/management_error_exception.rb', line 18 def error_description @error_description end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
53 54 55 56 57 |
# File 'lib/verizon/exceptions/management_error_exception.rb', line 53 def inspect class_name = self.class.name.split('::').last "<#{class_name} error: #{@error.inspect}, error_description: #{@error_description.inspect},"\ " cause: #{@cause.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
46 47 48 49 50 |
# File 'lib/verizon/exceptions/management_error_exception.rb', line 46 def to_s class_name = self.class.name.split('::').last "<#{class_name} error: #{@error}, error_description: #{@error_description}, cause:"\ " #{@cause}>" end |
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash. response body.
36 37 38 39 40 41 42 43 |
# File 'lib/verizon/exceptions/management_error_exception.rb', line 36 def unbox(hash) return nil unless hash @error = hash.key?('error') ? hash['error'] : SKIP @error_description = hash.key?('error_description') ? hash['error_description'] : SKIP @cause = hash.key?('cause') ? hash['cause'] : SKIP end |