dajac commented on a change in pull request #7498:
URL: https://github.com/apache/kafka/pull/7498#discussion_r520522778



##########
File path: 
clients/src/main/java/org/apache/kafka/clients/producer/internals/Sender.java
##########
@@ -588,17 +589,20 @@ private void handleProduceResponse(ClientResponse 
response, Map<TopicPartition,
     private void completeBatch(ProducerBatch batch, 
ProduceResponse.PartitionResponse response, long correlationId,
                                long now) {
         Errors error = response.error;
+        String errorMessageSuffix = (response.errorMessage == null || 
response.errorMessage.isEmpty()) ?
+            "" : String.format(". Error Message: %s", response.errorMessage);

Review comment:
       To address @cmccabe comment, we could replace this by a helper method as 
he suggested. The method could take the error and the errorMessage to format 
them appropriately.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to