private String formatErrMsg(ProduceResponse.PartitionResponse response) {
        String errorMessageSuffix = (response.errorMessage == null || response.errorMessage.isEmpty()) ?
                "" : String.format(". Error Message: %s", response.errorMessage);
        return String.format("%s%s", response.error, errorMessageSuffix);
    }
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