public Map<Long, Map<TopicPartition, Errors>> errorsByProducerId() {
        Map<Long, Map<TopicPartition, Errors>> errors = new HashMap<>();
        for (WritableTxnMarkerResult marker : data.markers()) {
            Map<TopicPartition, Errors> topicPartitionErrorsMap = new HashMap<>();
            for (WritableTxnMarkerTopicResult topic : marker.topics()) {
                for (WritableTxnMarkerPartitionResult partitionResult : topic.partitions()) {
                    topicPartitionErrorsMap.put(new TopicPartition(topic.name(), partitionResult.partitionIndex()),
                            Errors.forCode(partitionResult.errorCode()));
                }
            }
            errors.put(marker.producerId(), topicPartitionErrorsMap);
        }
        return errors;
    }
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