@Override
    public Map<Errors, Integer> errorCounts() {
        Map<Errors, Integer> errorCounts = new HashMap<>();
        for (WritableTxnMarkerResult marker : data.markers()) {
            for (WritableTxnMarkerTopicResult topic : marker.topics()) {
                for (WritableTxnMarkerPartitionResult partitionResult : topic.partitions())
                    updateErrorCounts(errorCounts, Errors.forCode(partitionResult.errorCode()));
            }
        }
        return errorCounts;
    }
Possible error codes:

  - {@link Errors#CORRUPT_MESSAGE}
  - {@link Errors#INVALID_PRODUCER_EPOCH}
  - {@link Errors#UNKNOWN_TOPIC_OR_PARTITION}
  - {@link Errors#NOT_LEADER_OR_FOLLOWER}
  - {@link Errors#MESSAGE_TOO_LARGE}
  - {@link Errors#RECORD_LIST_TOO_LARGE}
  - {@link Errors#NOT_ENOUGH_REPLICAS}
  - {@link Errors#NOT_ENOUGH_REPLICAS_AFTER_APPEND}
  - {@link Errors#INVALID_REQUIRED_ACKS}
  - {@link Errors#TRANSACTION_COORDINATOR_FENCED}
  - {@link Errors#REQUEST_TIMED_OUT}
  - {@link Errors#CLUSTER_AUTHORIZATION_FAILED}
clients/src/main/java/org/apache/kafka/common/requests/WriteTxnMarkersResponse.java