Exception: Bandwidth::UnauthorizedRequestException
- Inherits:
-
APIException
- Object
- StandardError
- APIException
- Bandwidth::UnauthorizedRequestException
- Defined in:
- lib/bandwidth/two_factor_auth_lib/two_factor_auth/exceptions/unauthorized_request_exception.rb
Overview
UnauthorizedRequest class.
Instance Attribute Summary collapse
-
#message ⇒ String
The message containing the reason behind the request being unauthorized.
Attributes inherited from APIException
Instance Method Summary collapse
-
#initialize(reason, response) ⇒ UnauthorizedRequestException
constructor
The constructor.
-
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash.
Constructor Details
#initialize(reason, response) ⇒ UnauthorizedRequestException
The constructor.
16 17 18 19 20 |
# File 'lib/bandwidth/two_factor_auth_lib/two_factor_auth/exceptions/unauthorized_request_exception.rb', line 16 def initialize(reason, response) super(reason, response) hash = APIHelper.json_deserialize(@response.raw_body) unbox(hash) end |
Instance Attribute Details
#message ⇒ String
The message containing the reason behind the request being unauthorized
11 12 13 |
# File 'lib/bandwidth/two_factor_auth_lib/two_factor_auth/exceptions/unauthorized_request_exception.rb', line 11 def @message end |
Instance Method Details
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash. response body.
25 26 27 |
# File 'lib/bandwidth/two_factor_auth_lib/two_factor_auth/exceptions/unauthorized_request_exception.rb', line 25 def unbox(hash) @message = hash['message'] end |