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.
20 21 22 23 24 |
# File 'lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/exceptions/error_with_request_exception.rb', line 20 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
11 12 13 |
# File 'lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/exceptions/error_with_request_exception.rb', line 11 def error @error end |
#request_id ⇒ String
The associated requestId from AWS
15 16 17 |
# File 'lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/exceptions/error_with_request_exception.rb', line 15 def request_id @request_id end |
Instance Method Details
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash. response body.
29 30 31 32 |
# File 'lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/exceptions/error_with_request_exception.rb', line 29 def unbox(hash) @error = hash['error'] @request_id = hash['requestId'] end |