Sha256: d6cfca4eeb2e011399afc59bc2ca5393cf5da35e836259b55d7aa98f8134e2fd
Contents?: true
Size: 1.02 KB
Versions: 2
Compression:
Stored size: 1.02 KB
Contents
require 'json' module BayonetClient class BayonetError < Exception attr_accessor :request_body, :request_headers, :http_response_code, :http_response_json, :reason_code, :reason_message def initialize(request_body, request_headers, http_response_code, http_response_json) self.request_body = request_body self.request_headers = request_headers self.http_response_code = http_response_code self.http_response_json = http_response_json # Get reason_code and reason_message from response if http_response_json.class == HTTParty::Response && http_response_json.key?('reason_code') self.reason_code = http_response_json['reason_code'] end if http_response_json.class == HTTParty::Response && http_response_json.key?('reason_message') self.reason_message = http_response_json['reason_message'] else self.reason_message = http_response_json end end end class InvalidClientSetupError < Exception end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
bayonet_client-1.0.0 | lib/bayonet_client/exceptions.rb |
bayonet_client-0.1.0 | lib/bayonet_client/exceptions.rb |