lib/active_merchant/common/connection.rb in activemerchant-1.9.1 vs lib/active_merchant/common/connection.rb in activemerchant-1.9.2

- old
+ new

@@ -69,13 +69,12 @@ raise ArgumentError, "Unsupported request method #{method.to_s.upcase}" end end info "--> %d %s (%d %.4fs)" % [result.code, result.message, result.body ? result.body.length : 0, realtime], tag - response = handle_response(result) - debug response - response + debug result.body + result rescue EOFError => e raise ConnectionError, "The remote server dropped the connection" rescue Errno::ECONNRESET => e raise ConnectionError, "The remote server reset the connection" rescue Errno::ECONNREFUSED => e @@ -145,19 +144,10 @@ retry if retry_safe && !retries.zero? raise end end - def handle_response(response) - case response.code.to_i - when 200...300 - response.body - else - raise ResponseError.new(response) - end - end - def debug(message, tag = nil) log(:debug, message, tag) end def info(message, tag = nil) @@ -167,6 +157,6 @@ def log(level, message, tag) message = "[#{tag}] #{message}" if tag logger.send(level, message) if logger end end -end \ No newline at end of file +end