Exception: Bandwidth::ErrorResponseException
- Inherits:
-
APIException
- Object
- StandardError
- APIException
- Bandwidth::ErrorResponseException
- Defined in:
- lib/bandwidth/voice_lib/voice/exceptions/error_response_exception.rb
Overview
ErrorResponse class.
Instance Attribute Summary collapse
-
#description ⇒ String
TODO: Write general description for this method.
-
#id ⇒ String
TODO: Write general description for this method.
-
#type ⇒ TypeEnum
TODO: Write general description for this method.
Attributes inherited from APIException
Instance Method Summary collapse
-
#initialize(reason, response) ⇒ ErrorResponseException
constructor
The constructor.
-
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash.
Constructor Details
#initialize(reason, response) ⇒ ErrorResponseException
The constructor.
24 25 26 27 28 |
# File 'lib/bandwidth/voice_lib/voice/exceptions/error_response_exception.rb', line 24 def initialize(reason, response) super(reason, response) hash = APIHelper.json_deserialize(@response.raw_body) unbox(hash) end |
Instance Attribute Details
#description ⇒ String
TODO: Write general description for this method
15 16 17 |
# File 'lib/bandwidth/voice_lib/voice/exceptions/error_response_exception.rb', line 15 def description @description end |
#id ⇒ String
TODO: Write general description for this method
19 20 21 |
# File 'lib/bandwidth/voice_lib/voice/exceptions/error_response_exception.rb', line 19 def id @id end |
#type ⇒ TypeEnum
TODO: Write general description for this method
11 12 13 |
# File 'lib/bandwidth/voice_lib/voice/exceptions/error_response_exception.rb', line 11 def type @type end |
Instance Method Details
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash. response body.
33 34 35 36 37 |
# File 'lib/bandwidth/voice_lib/voice/exceptions/error_response_exception.rb', line 33 def unbox(hash) @type = hash['type'] @description = hash['description'] @id = hash['id'] end |