Exception: Blingee::ErrorWithResponse

Inherits:
Error
  • Object
show all
Defined in:
lib/blingee/exceptions.rb

Direct Known Subclasses

AuthenticationFailure

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Error

from_exception

Instance Attribute Details

#responseObject

Returns the value of attribute response.



14
15
16
# File 'lib/blingee/exceptions.rb', line 14

def response
  @response
end

Class Method Details

.from_exception_with_response(e, response) ⇒ Object



16
17
18
19
20
# File 'lib/blingee/exceptions.rb', line 16

def self.from_exception_with_response(e, response)
  from_exception(e).tap do |exception|
    exception.response = response
  end
end

Instance Method Details

#http_codeObject



22
23
24
# File 'lib/blingee/exceptions.rb', line 22

def http_code
  response.code.to_i if response
end