Sha256: 7a2524a3ea11fdc9d5c1a1ee8e56978f186e062866cb309308164ff6fa7d98c3
Contents?: true
Size: 805 Bytes
Versions: 9
Compression:
Stored size: 805 Bytes
Contents
module Transferwise STATUS_CLASS_MAPPING = { 400 => "InvalidRequestError", 404 => "InvalidRequestError", 401 => "AuthenticationError" } class TransferwiseError < StandardError attr_reader :message, :http_status, :http_body, :http_headers, :json_body def initialize(params = {}) params.each do |key, value| instance_variable_set("@#{key}", value) end end def to_s status_string = @http_status.nil? ? "" : "(Status #{@http_status}) " "#{status_string}#{@message}" end end class APIConnectionError < TransferwiseError end class APIError < TransferwiseError end class AuthenticationError < TransferwiseError end class InvalidRequestError < TransferwiseError end class ParseError < TransferwiseError end end
Version data entries
9 entries across 9 versions & 2 rubygems