hachikuji commented on a change in pull request #9781:
URL: https://github.com/apache/kafka/pull/9781#discussion_r549426896
##########
File path:
clients/src/main/java/org/apache/kafka/common/requests/UpdateFeaturesRequest.java
##########
@@ -56,19 +54,11 @@ public UpdateFeaturesRequest(UpdateFeaturesRequestData
data, short version) {
@Override
public AbstractResponse getErrorResponse(int throttleTimeMs, Throwable e) {
- final ApiError apiError = ApiError.fromThrowable(e);
- final UpdatableFeatureResultCollection results = new
UpdatableFeatureResultCollection();
- for (FeatureUpdateKey update : this.data.featureUpdates().valuesSet())
{
- final UpdatableFeatureResult result = new UpdatableFeatureResult()
- .setFeature(update.feature())
- .setErrorCode(apiError.error().code())
- .setErrorMessage(apiError.message());
- results.add(result);
- }
- final UpdateFeaturesResponseData responseData = new
UpdateFeaturesResponseData()
- .setThrottleTimeMs(throttleTimeMs)
- .setResults(results);
- return new UpdateFeaturesResponse(responseData);
+ return UpdateFeaturesResponse.createWithErrors(
+ ApiError.fromThrowable(e),
+ Collections.emptyMap(),
Review comment:
@chia7712 Good catch. Pushed an update with some test cases.
----------------------------------------------------------------
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:
[email protected]