Exception: Chain::JSONError

Inherits:
BaseError
  • Object
show all
Defined in:
lib/chain/errors.rb

Overview

JSONError should be very rare, and will only arise if there is a bug in the Chain API, or if the upstream server is spoofing common Chain API response headers.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request_id, response) ⇒ JSONError

Returns a new instance of JSONError.



26
27
28
29
30
# File 'lib/chain/errors.rb', line 26

def initialize(request_id, response)
  super "Error decoding JSON response. Request-ID: #{request_id}"
  self.request_id = request_id
  self.response = response
end

Instance Attribute Details

#request_idObject

Returns the value of attribute request_id.



23
24
25
# File 'lib/chain/errors.rb', line 23

def request_id
  @request_id
end

#responseObject

Returns the value of attribute response.



24
25
26
# File 'lib/chain/errors.rb', line 24

def response
  @response
end