def request(method, path, *arguments)
      response = http.send(method, path, *arguments)
      response.uri = URI.join(endpoint, path)

      handle_response(response)

    rescue Timeout::Error, Net::OpenTimeout => e
      raise TimeoutError.new(@request, e.message)
    rescue OpenSSL::SSL::SSLError => e
      raise SSLError.new(@request, e.message)
    rescue SocketError,
           EOFError,
           Net::HTTPBadResponse,
           Net::HTTPHeaderSyntaxError,
           Net::HTTPServerException,
           Net::ProtocolError,
           Errno::ECONNABORTED,
           Errno::ECONNREFUSED,
           Errno::ECONNRESET,
           Errno::ETIMEDOUT,
           Errno::ENETUNREACH,
           Errno::EHOSTUNREACH,
           Errno::EINVAL,
           Errno::ENOPROTOOPT => e
      raise ErrnoError.new(@request, e.message)
    rescue Zlib::DataError,
           Zlib::BufError => e
      raise ZlibError.new(@request, e.message)
    end
def request(method, path, *arguments)
      response = http.send(method, path, *arguments)
      response.uri = URI.join(endpoint, path)

      handle_response(response)

    rescue Timeout::Error, Net::OpenTimeout => e
      raise TimeoutError.new(@request, e.message)
    rescue OpenSSL::SSL::SSLError => e
      raise SSLError.new(@request, e.message)
    rescue SocketError,
           EOFError,
           Net::HTTPBadResponse,
           Net::HTTPHeaderSyntaxError,
           Net::HTTPServerException,
           Net::ProtocolError,
           Errno::ECONNABORTED,
           Errno::ECONNREFUSED,
           Errno::ECONNRESET,
           Errno::ETIMEDOUT,
           Errno::ENETUNREACH,
           Errno::EHOSTUNREACH,
           Errno::EINVAL,
           Errno::ENOPROTOOPT => e
      raise ErrnoError.new(@request, e.message)
    rescue Zlib::DataError,
           Zlib::BufError => e
      raise ZlibError.new(@request, e.message)
    end
Makes a request to the remote service.