Class: Verizon::DeviceDiagnosticsResultException
- Inherits:
-
APIException
- Object
- CoreLibrary::ApiException
- APIException
- Verizon::DeviceDiagnosticsResultException
- Defined in:
- lib/verizon/exceptions/device_diagnostics_result_exception.rb
Overview
All error messages are returned in this format. Error codes and messages are listed on the Error Codes page, along with explanations and suggestions for corrective actions.
Instance Attribute Summary collapse
-
#error_code ⇒ String
Simple error code.
-
#error_message ⇒ String
Detailed error message.
Instance Method Summary collapse
-
#initialize(reason, response) ⇒ DeviceDiagnosticsResultException
constructor
The constructor.
-
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash.
Constructor Details
#initialize(reason, response) ⇒ DeviceDiagnosticsResultException
The constructor.
25 26 27 28 29 |
# File 'lib/verizon/exceptions/device_diagnostics_result_exception.rb', line 25 def initialize(reason, response) super(reason, response) hash = APIHelper.json_deserialize(@response.raw_body) unbox(hash) end |
Instance Attribute Details
#error_code ⇒ String
Simple error code.
16 17 18 |
# File 'lib/verizon/exceptions/device_diagnostics_result_exception.rb', line 16 def error_code @error_code end |
#error_message ⇒ String
Detailed error message.
20 21 22 |
# File 'lib/verizon/exceptions/device_diagnostics_result_exception.rb', line 20 def @error_message end |
Instance Method Details
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash. response body.
34 35 36 37 |
# File 'lib/verizon/exceptions/device_diagnostics_result_exception.rb', line 34 def unbox(hash) @error_code = hash.key?('errorCode') ? hash['errorCode'] : nil @error_message = hash.key?('errorMessage') ? hash['errorMessage'] : nil end |