Exception: Bandwidth::ErrorWithRequestException
- Inherits:
-
APIException
- Object
- StandardError
- APIException
- Bandwidth::ErrorWithRequestException
- Defined in:
- lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/exceptions/error_with_request_exception.rb
Overview
ErrorWithRequest class.
Instance Attribute Summary collapse
-
#error ⇒ String
An error message pertaining to what the issue could be.
-
#request_id ⇒ String
The associated requestId from AWS.
Attributes inherited from APIException
Instance Method Summary collapse
-
#initialize(reason, response) ⇒ ErrorWithRequestException
constructor
The constructor.
-
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash.
Constructor Details
#initialize(reason, response) ⇒ ErrorWithRequestException
The constructor.
23 24 25 26 27 |
# File 'lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/exceptions/error_with_request_exception.rb', line 23 def initialize(reason, response) super(reason, response) hash = APIHelper.json_deserialize(@response.raw_body) unbox(hash) end |
Instance Attribute Details
#error ⇒ String
An error message pertaining to what the issue could be
14 15 16 |
# File 'lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/exceptions/error_with_request_exception.rb', line 14 def error @error end |
#request_id ⇒ String
The associated requestId from AWS
18 19 20 |
# File 'lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/exceptions/error_with_request_exception.rb', line 18 def request_id @request_id end |
Instance Method Details
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash. response body.
32 33 34 35 |
# File 'lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/exceptions/error_with_request_exception.rb', line 32 def unbox(hash) @error = hash.key?('error') ? hash['error'] : SKIP @request_id = hash.key?('requestId') ? hash['requestId'] : SKIP end |