Exception: Bandwidth::ErrorException
- Inherits:
-
APIException
- Object
- StandardError
- APIException
- Bandwidth::ErrorException
- Defined in:
- lib/bandwidth/web_rtc_lib/web_rtc/exceptions/error_exception.rb
Overview
Error class.
Instance Attribute Summary collapse
-
#code ⇒ Integer
TODO: Write general description for this method.
-
#message ⇒ String
TODO: Write general description for this method.
Attributes inherited from APIException
Instance Method Summary collapse
-
#initialize(reason, response) ⇒ ErrorException
constructor
The constructor.
-
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash.
Constructor Details
#initialize(reason, response) ⇒ ErrorException
The constructor.
23 24 25 26 27 |
# File 'lib/bandwidth/web_rtc_lib/web_rtc/exceptions/error_exception.rb', line 23 def initialize(reason, response) super(reason, response) hash = APIHelper.json_deserialize(@response.raw_body) unbox(hash) end |
Instance Attribute Details
#code ⇒ Integer
TODO: Write general description for this method
14 15 16 |
# File 'lib/bandwidth/web_rtc_lib/web_rtc/exceptions/error_exception.rb', line 14 def code @code end |
#message ⇒ String
TODO: Write general description for this method
18 19 20 |
# File 'lib/bandwidth/web_rtc_lib/web_rtc/exceptions/error_exception.rb', line 18 def @message 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/web_rtc_lib/web_rtc/exceptions/error_exception.rb', line 32 def unbox(hash) @code = hash.key?('code') ? hash['code'] : SKIP @message = hash.key?('message') ? hash['message'] : SKIP end |