Exception: ApiWrapperFor8x8::ResponseError
- Inherits:
-
Exception
- Object
- Exception
- ApiWrapperFor8x8::ResponseError
- Defined in:
- lib/ApiWrapperFor8x8/error.rb
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
- #code ⇒ Object
- #common_solutions ⇒ Object
- #detailed_message ⇒ Object
-
#initialize(response, message = nil) ⇒ ResponseError
constructor
A new instance of ResponseError.
Constructor Details
#initialize(response, message = nil) ⇒ ResponseError
Returns a new instance of ResponseError.
5 6 7 8 9 |
# File 'lib/ApiWrapperFor8x8/error.rb', line 5 def initialize(response, =nil) self.set_backtrace(caller[1..-1]) if self.backtrace.nil? @response = response super(( || @response.)) end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
3 4 5 |
# File 'lib/ApiWrapperFor8x8/error.rb', line 3 def response @response end |
Instance Method Details
#code ⇒ Object
11 12 13 |
# File 'lib/ApiWrapperFor8x8/error.rb', line 11 def code @response.code end |
#common_solutions ⇒ Object
15 16 17 18 19 |
# File 'lib/ApiWrapperFor8x8/error.rb', line 15 def common_solutions if @response.code.to_i == 401 "Check your credentials and make sure they are correct and not expired" end end |
#detailed_message ⇒ Object
21 22 23 24 25 |
# File 'lib/ApiWrapperFor8x8/error.rb', line 21 def if @response.is_a? Hash @response[:error][:message] if @response[:error] end end |