def retryer(&blk)
      loop do
        @try_count += 1
        y = blk.call(@try_count, @retry_exception)
        @retry_exception = nil # no exception was raised in the block
        return y if y
        raise Bosh::Common::RetryCountExceeded if @try_count >= @retry_limit
        wait
      end
    rescue Exception => exception
      raise unless @matchers.any? { |m| m.matches?(exception) }
      raise unless exception.message =~ @matching
      raise if @try_count >= @retry_limit

      @retry_exception = exception
      wait
      retry
    ensure
      @ensure_callback.call(@try_count)
    end
def retryer(&blk)
      loop do
        @try_count += 1
        y = blk.call(@try_count, @retry_exception)
        @retry_exception = nil # no exception was raised in the block
        return y if y
        raise Bosh::Common::RetryCountExceeded if @try_count >= @retry_limit
        wait
      end
    rescue Exception => exception
      raise unless @matchers.any? { |m| m.matches?(exception) }
      raise unless exception.message =~ @matching
      raise if @try_count >= @retry_limit

      @retry_exception = exception
      wait
      retry
    ensure
      @ensure_callback.call(@try_count)
    end
Loops until the block returns a true value