EllanJiang/GameFramework · error · GameFrameworkException

Data node is not exist, path

Error message

Data node is not exist, path '{0}', node '{1}'.

What it means

DataNodeManager.GetData<T> throws this GameFrameworkException when GetNode(path, node) cannot resolve the given path under the given (or root) node, i.e. the resolved data node is null. The message includes both the requested path and the FullName of the starting node (empty string when starting from root). The node exists check happens before any type conversion; type errors on the stored Variable surface separately.

Solutions

  1. Use dataNodeManager.HasData<T>(path) (or check GetNode result) before calling GetData<T>
  2. Print/compare node.FullName paths — verify the exact path and start node match the created tree
  3. Ensure the node subtree is created (GetOrAddNode/SetData) before reading
  4. Restore or re-create removed nodes, or query the correct root/start node

Example fix

// before
VarInt32 hp = dataNodeManager.GetData<VarInt32>("Player/HP");
// after
if (dataNodeManager.HasData<VarInt32>("Player/HP"))
{
    VarInt32 hp = dataNodeManager.GetData<VarInt32>("Player/HP");
}
else
{
    VarInt32 hp = new VarInt32(100);
}
Defensive patterns

Strategy: try-catch

Validate before calling

if (!dataNodeManager.HasData<T>(path))
{
    return defaultValue;
}

Try / catch

try { return dataNodeManager.GetData<VarInt32>(path); }
catch (GameFrameworkException ex)
{
    Log.Warn($"Missing data node: {ex.Message}");
    return defaultValue;
}

Prevention

When it happens

Trigger: Calling GetData<T>("a/b/c") where a segment was never created; querying a node that was removed (RemoveNode) or in a different subtree than the provided start node; path typos or case mismatches; calling before the relevant node tree was built during load.

Common situations: Data written under a different prefix (e.g. 'Game/Player/HP' vs 'Player/HP'); paths assembled from variables with an empty segment; a data node removed on scene unload but queried afterwards; save-data migration renaming node paths.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of EllanJiang/GameFramework@d0c010b051 (2026-09-15). Data as JSON: /api/errors/c08835363f744cb9. Report an issue: GitHub.

Appendix: source

Thrown at GameFramework/DataNode/DataNodeManager.cs:93

        /// <returns>数据结点的数据。</returns>
        public Variable GetData(string path)
        {
            return GetData(path, null);
        }

        /// <summary>
        /// 根据类型获取数据结点的数据。
        /// </summary>
        /// <typeparam name="T">要获取的数据类型。</typeparam>
        /// <param name="path">相对于 node 的查找路径。</param>
        /// <param name="node">查找起始结点。</param>
        /// <returns>指定类型的数据。</returns>
        public T GetData<T>(string path, IDataNode node) where T : Variable
        {
            IDataNode current = GetNode(path, node);
            if (current == null)
            {
                throw new GameFrameworkException(Utility.Text.Format("Data node is not exist, path '{0}', node '{1}'.", path, node != null ? node.FullName : string.Empty));
            }

            return current.GetData<T>();
        }

        /// <summary>
        /// 获取数据结点的数据。
        /// </summary>
        /// <param name="path">相对于 node 的查找路径。</param>
        /// <param name="node">查找起始结点。</param>
        /// <returns>数据结点的数据。</returns>
        public Variable GetData(string path, IDataNode node)
        {
            IDataNode current = GetNode(path, node);
            if (current == null)
            {
                throw new GameFrameworkException(Utility.Text.Format("Data node is not exist, path '{0}', node '{1}'.", path, node != null ? node.FullName : string.Empty));
            }

View on GitHub (pinned to d0c010b051)