Sha256: 15d8c31d7982b32719328b7b73b28854e0d4b6c3ba2922589fe51f3ee8b0a809
Contents?: true
Size: 647 Bytes
Versions: 16
Compression:
Stored size: 647 Bytes
Contents
module EasyPost class Error < StandardError attr_reader :message attr_reader :http_status attr_reader :http_body attr_reader :json_body attr_reader :param def initialize(message=nil, http_status=nil, http_body=nil, json_body=nil) @message = message @http_status = http_status @http_body = http_body @json_body = json_body begin @param = @json_body[:error][:param] rescue @param = nil end super(message) end def to_s status_string = @http_status.nil? ? "" : "(Status #{@http_status}) " "#{status_string}#{@message}" end end end
Version data entries
16 entries across 16 versions & 1 rubygems