private void completeBatch(ProducerBatch batch, ProduceResponse.PartitionResponse response) {
        if (transactionManager != null) {
            transactionManager.handleCompletedBatch(batch, response);
        }

        if (batch.complete(response.baseOffset, response.logAppendTime)) {
            maybeRemoveAndDeallocateBatch(batch);
        }
    }
Format the error from a {@link ProduceResponse.PartitionResponse} in a user-friendly string
e.g "NETWORK_EXCEPTION. Error Message: Disconnected from node 0"
clients/src/main/java/org/apache/kafka/clients/producer/internals/Sender.java