chia7712 commented on code in PR #19027: URL: https://github.com/apache/kafka/pull/19027#discussion_r1970725921
########## clients/src/main/java/org/apache/kafka/common/requests/UnregisterBrokerRequest.java: ########## @@ -57,7 +57,8 @@ public UnregisterBrokerResponse getErrorResponse(int throttleTimeMs, Throwable e Errors error = Errors.forException(e); return new UnregisterBrokerResponse(new UnregisterBrokerResponseData() .setThrottleTimeMs(throttleTimeMs) - .setErrorCode(error.code())); + .setErrorCode(error.code()) + .setErrorMessage(error.message() + ", " + e.getMessage())); Review Comment: In this case, `error.message()` returns the constant message associated with the `Error`. In contrast, `e.getMessage()` returns the "true" message, which is more valuable as part of the response. So +1 to use `e.getMessage()` only -- 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-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org