Sha256: c37d8515ddc14defa9a3705d3d7545f7309995e6f0c41e778c47d92c5d2e284e
Contents?: true
Size: 841 Bytes
Versions: 5
Compression:
Stored size: 841 Bytes
Contents
module GifterHub module Errors class GifterHubError < StandardError attr_reader :message attr_reader :http_status attr_reader :http_body attr_reader :http_headers attr_reader :request_id attr_reader :json_body def initialize(message=nil, http_status=nil, http_body=nil, json_body=nil, http_headers=nil) @message = message @http_status = http_status @http_body = http_body @http_headers = http_headers || {} @json_body = json_body @request_id = @http_headers[:request_id] end def to_s status_string = @http_status.nil? ? "" : "(Status #{@http_status}) " id_string = @request_id.nil? ? "" : "(Request #{@request_id}) " "#{status_string}#{id_string}#{@message}" end end end end
Version data entries
5 entries across 5 versions & 1 rubygems