@Override
    public Map<Errors, Integer> errorCounts() {
        if (data.errorCode() != Errors.NONE.code())
            // Minor optimization since the top-level error applies to all partitions
            return Collections.singletonMap(error(), data.partitionErrors().size() + 1);
        Map<Errors, Integer> errors = errorCounts(data.partitionErrors().stream().map(p -> Errors.forCode(p.errorCode())));
        updateErrorCounts(errors, Errors.forCode(data.errorCode())); // top level error
        return errors;
    }
Possible error code:
 - {@link Errors#STALE_CONTROLLER_EPOCH}
 - {@link Errors#STALE_BROKER_EPOCH}
 - {@link Errors#FENCED_LEADER_EPOCH}
 - {@link Errors#KAFKA_STORAGE_ERROR}
clients/src/main/java/org/apache/kafka/common/requests/StopReplicaResponse.java