def handle_no_result(no_result, host)
      server_name = @server_name || host
      e = no_result.details.values.flatten.last
      if no_result.details.empty?
        yield(no_result)
        raise NotResponding.new("#{server_name} not responding", no_result)
      elsif e.respond_to?(:http_code) && RETRY_STATUS_CODES.include?(e.http_code)
        yield(e)
        if e.http_code == 504 && (e.http_body && !e.http_body.empty?)
          raise NotResponding.new(e.http_body, e)
        else
          raise NotResponding.new("#{server_name} not responding", e)
        end
      elsif e.is_a?(RestClient::RequestTimeout)
        # Special case RequestTimeout because http_code is typically nil given no actual response
        yield(e)
        raise NotResponding.new("Request timeout", e)
      else
        yield(e)
        raise e
      end
      true
    end
def handle_no_result(no_result, host)
      server_name = @server_name || host
      e = no_result.details.values.flatten.last
      if no_result.details.empty?
        yield(no_result)
        raise NotResponding.new("#{server_name} not responding", no_result)
      elsif e.respond_to?(:http_code) && RETRY_STATUS_CODES.include?(e.http_code)
        yield(e)
        if e.http_code == 504 && (e.http_body && !e.http_body.empty?)
          raise NotResponding.new(e.http_body, e)
        else
          raise NotResponding.new("#{server_name} not responding", e)
        end
      elsif e.is_a?(RestClient::RequestTimeout)
        # Special case RequestTimeout because http_code is typically nil given no actual response
        yield(e)
        raise NotResponding.new("Request timeout", e)
      else
        yield(e)
        raise e
      end
      true
    end
Handle no result from balancer
 Distinguish the not responding case since it likely warrants a retry by the client
 Also try to distinguish between the targeted server not responding and that server
 gatewaying to another server that is not responding, so that the receiver of
 the resulting exception is clearer as to the source of the problem

 @param [RightSupport::Net::NoResult] no_result exception raised by request balancer when it
   could not deliver request
 @param [String] host server URL where request was attempted

 @yield [exception] required block called for reporting exception of interest
 @yieldparam [Exception] exception extracted

 @return [TrueClass] always true

 @raise [NotResponding] server not responding, recommend retry