public Map<Errors, Integer> errorCounts(Throwable e) {
        AbstractResponse response = getErrorResponse(0, e);
        if (response == null)
            throw new IllegalStateException("Error counts could not be obtained for request " + this);
        else
            return response.errorCounts();
    }
Get the error counts corresponding to an error response. This is overridden for requests
where response may be null (e.g produce with acks=0).
clients/src/main/java/org/apache/kafka/common/requests/AbstractRequest.java