docs: private void handleAttemptError(Throwable rpcError) {
      ApiException entryError = createSyntheticErrorForRpcFailure(rpcError);
      ImmutableList.Builder<FailedMutation> allFailures = ImmutableList.builder();
      MutateRowsRequest lastRequest = currentRequest;
  
      allFailures.addAll(permanentFailures);
  
      Builder builder = lastRequest.toBuilder().clearEntries();
      List<Integer> newOriginalIndexes = Lists.newArrayList();
  
      for (int i = 0; i < currentRequest.getEntriesCount(); i++) {
        int origIndex = getOriginalIndex(i);
  
        FailedMutation failedMutation = FailedMutation.create(origIndex, entryError);
        allFailures.add(failedMutation);
  
        if (!failedMutation.getError().isRetryable()) {
          permanentFailures.add(failedMutation);
        } else {
          // Schedule the mutation entry for the next RPC by adding it to the request builder and
          // recording its original index
          newOriginalIndexes.add(origIndex);
          builder.addEntries(lastRequest.getEntries(i));
        }
      }
  
      currentRequest = builder.build();
      originalIndexes = newOriginalIndexes;
  
      throw new MutateRowsException(rpcError, allFailures.build(), entryError.isRetryable());
    }