lib/coin_rpc/xrp.rb
#
# Performs JSON RPC call, yields error and parsed response.
# It also prints error message and backtrace in case of error.
# If raise: true is passed it will raise caught errors.
#
Performs JSON RPC call, yields error and parsed response.
It also prints error message and backtrace in case of error.
If raise: true is passed it will raise caught errors.
Performs JSON RPC call yields error and parsed response . It also prints error message and backtrace in case of error . If raise : true is passed it will raise caught errors .
def perform_request(data, options = {})
      response = JSON.parse(http_post_request(Hash === data ? data.to_json : data))
      error    = retrieve_error(response)
      raise JSONRPCError, error if error && options.fetch(:raise, false)
      yield error, response
    rescue => e
      report_exception_to_screen(e)
      raise e if JSONRPCError === e
      raise JSONRPCError, e.inspect if options.fetch(:raise, false)
    end
def perform_request ( data , options = { } ) response = JSON . parse ( http_post_request ( Hash === data ? data . to_json : data ) ) error = retrieve_error ( response ) raise JSONRPCError , error if error && options . fetch ( :raise , false ) yield error , response rescue => e report_exception_to_screen ( e ) raise e if JSONRPCError === e raise JSONRPCError , e . inspect if options . fetch ( :raise , false ) end
Performs JSON RPC call, yields error and parsed response.
Performs JSON RPC call yields error and parsed response .
data
options