Exception: ApiAuth::Client::ErrorWithJson

Inherits:
StandardError
  • Object
show all
Defined in:
lib/api_auth/client/error_with_json.rb

Direct Known Subclasses

ApiEndpointError, ConnectionError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, response = nil, status = nil) ⇒ ErrorWithJson

Returns a new instance of ErrorWithJson.



8
9
10
11
12
13
# File 'lib/api_auth/client/error_with_json.rb', line 8

def initialize(message = nil, response = nil, status = nil)
  super(message)
  self.response = response
  self.status = status || (response.is_a?(RestClient::Response) && response.code)
  self.json = response.to_json
end

Instance Attribute Details

#jsonObject

Returns the value of attribute json.



6
7
8
# File 'lib/api_auth/client/error_with_json.rb', line 6

def json
  @json
end

#responseObject

Returns the value of attribute response.



6
7
8
# File 'lib/api_auth/client/error_with_json.rb', line 6

def response
  @response
end

#statusObject

Returns the value of attribute status.



6
7
8
# File 'lib/api_auth/client/error_with_json.rb', line 6

def status
  @status
end