@Override
    public Map<Errors, Integer> errorCounts() {
        List<Errors> allErrors = new ArrayList<>();

        // If we are not using this field, we have request 4 or later
        if (this.data.resultsByTopicV3AndBelow().isEmpty()) {
            allErrors.add(Errors.forCode(data.errorCode()));
        }
        
        errors().forEach((txnId, errors) -> 
            allErrors.addAll(errors.values())
        );
        return errorCounts(allErrors);
    }
Possible error codes:

  - {@link Errors#NOT_COORDINATOR}
  - {@link Errors#COORDINATOR_NOT_AVAILABLE}
  - {@link Errors#COORDINATOR_LOAD_IN_PROGRESS}
  - {@link Errors#INVALID_TXN_STATE}
  - {@link Errors#INVALID_PRODUCER_ID_MAPPING}
  - {@link Errors#INVALID_PRODUCER_EPOCH} // for version <=1
  - {@link Errors#PRODUCER_FENCED}
  - {@link Errors#TOPIC_AUTHORIZATION_FAILED}
  - {@link Errors#TRANSACTIONAL_ID_AUTHORIZATION_FAILED}
  - {@link Errors#UNKNOWN_TOPIC_OR_PARTITION}
clients/src/main/java/org/apache/kafka/common/requests/AddPartitionsToTxnResponse.java