public static boolean hasOnlyErrorsOfType(Reply reply, int errCode) {
        if (!reply.hasErrors()) {
            return false;
        }
        for (int i = 0; i < reply.getNumErrors(); ++i) {
            if (reply.getError(i).getCode() != errCode) {
                return false;
            }
        }
        return true;
    }
Returns true if the given reply has at least one error, and all errors are of the given type.

@param reply   the reply to check for error
@param errCode the error code to check for
@return whether or not the reply has only the given error code
documentapi/src/main/java/com/yahoo/documentapi/messagebus/protocol/DocumentProtocol.java