You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/09/03 12:44:25 UTC

[GitHub] [kafka] dajac commented on a change in pull request #11288: MINOR: Fix error response generation

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



##########
File path: clients/src/main/java/org/apache/kafka/common/requests/DescribeProducersRequest.java
##########
@@ -69,7 +71,7 @@ public DescribeProducersRequestData data() {
     @Override
     public DescribeProducersResponse getErrorResponse(int throttleTimeMs, Throwable e) {
         Errors error = Errors.forException(e);
-        DescribeProducersResponseData response = new DescribeProducersResponseData();
+        List<TopicResponse> topics = new ArrayList<>();

Review comment:
       nit: We could keep instantiating `DescribeProducersResponseData` here and add the topic to it with `reponse.topics.add(..)`.

##########
File path: clients/src/main/java/org/apache/kafka/common/requests/AlterClientQuotasRequest.java
##########
@@ -125,7 +127,10 @@ public AlterClientQuotasResponse getErrorResponse(int throttleTimeMs, Throwable
                     .setEntityType(entityData.entityType())
                     .setEntityName(entityData.entityName()));
             }
-            responseEntries.add(new AlterClientQuotasResponseData.EntryData().setEntity(responseEntities));
+            responseEntries.add(new AlterClientQuotasResponseData.EntryData()
+                    .setEntity(responseEntities)
+                    .setErrorCode(error.code())
+                    .setErrorMessage(error.message()));

Review comment:
       nit: Should we use 4 spaces to indent those ones here? We use 4 spaces for similar code at L127/128 so the code would remain a bit more homogeneous. 




-- 
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.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

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