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.
20 21 22 23 24 |
# File 'lib/bandwidth/web_rtc_lib/web_rtc/exceptions/error_exception.rb', line 20 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
11 12 13 |
# File 'lib/bandwidth/web_rtc_lib/web_rtc/exceptions/error_exception.rb', line 11 def code @code end |
#message ⇒ String
TODO: Write general description for this method
15 16 17 |
# File 'lib/bandwidth/web_rtc_lib/web_rtc/exceptions/error_exception.rb', line 15 def @message 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/web_rtc_lib/web_rtc/exceptions/error_exception.rb', line 29 def unbox(hash) @code = hash['code'] @message = hash['message'] end |