{"record":{"id":"c08835363f744cb9","repo":"EllanJiang/GameFramework","slug":"data-node-is-not-exist-path-0-node-1","errorCode":null,"errorMessage":"Data node is not exist, path '{0}', node '{1}'.","messagePattern":"Data node is not exist, path '(.+?)', node '(.+?)'\\.","errorType":"exception","errorClass":"GameFrameworkException","httpStatus":null,"severity":"error","filePath":"GameFramework/DataNode/DataNodeManager.cs","lineNumber":93,"sourceCode":"        /// <returns>数据结点的数据。</returns>\n        public Variable GetData(string path)\n        {\n            return GetData(path, null);\n        }\n\n        /// <summary>\n        /// 根据类型获取数据结点的数据。\n        /// </summary>\n        /// <typeparam name=\"T\">要获取的数据类型。</typeparam>\n        /// <param name=\"path\">相对于 node 的查找路径。</param>\n        /// <param name=\"node\">查找起始结点。</param>\n        /// <returns>指定类型的数据。</returns>\n        public T GetData<T>(string path, IDataNode node) where T : Variable\n        {\n            IDataNode current = GetNode(path, node);\n            if (current == null)\n            {\n                throw new GameFrameworkException(Utility.Text.Format(\"Data node is not exist, path '{0}', node '{1}'.\", path, node != null ? node.FullName : string.Empty));\n            }\n\n            return current.GetData<T>();\n        }\n\n        /// <summary>\n        /// 获取数据结点的数据。\n        /// </summary>\n        /// <param name=\"path\">相对于 node 的查找路径。</param>\n        /// <param name=\"node\">查找起始结点。</param>\n        /// <returns>数据结点的数据。</returns>\n        public Variable GetData(string path, IDataNode node)\n        {\n            IDataNode current = GetNode(path, node);\n            if (current == null)\n            {\n                throw new GameFrameworkException(Utility.Text.Format(\"Data node is not exist, path '{0}', node '{1}'.\", path, node != null ? node.FullName : string.Empty));\n            }","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/EllanJiang/GameFramework/blob/d0c010b05167c58e92350449d04864a91ca13fd2/GameFramework/DataNode/DataNodeManager.cs#L75-L111","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Use dataNodeManager.HasData<T>(path) (or check GetNode result) before calling GetData<T>","Print/compare node.FullName paths — verify the exact path and start node match the created tree","Ensure the node subtree is created (GetOrAddNode/SetData) before reading","Restore or re-create removed nodes, or query the correct root/start node"],"exampleFix":"// before\nVarInt32 hp = dataNodeManager.GetData<VarInt32>(\"Player/HP\");\n// after\nif (dataNodeManager.HasData<VarInt32>(\"Player/HP\"))\n{\n    VarInt32 hp = dataNodeManager.GetData<VarInt32>(\"Player/HP\");\n}\nelse\n{\n    VarInt32 hp = new VarInt32(100);\n}","handlingStrategy":"try-catch","validationCode":"if (!dataNodeManager.HasData<T>(path))\n{\n    return defaultValue;\n}","typeGuard":null,"tryCatchPattern":"try { return dataNodeManager.GetData<VarInt32>(path); }\ncatch (GameFrameworkException ex)\n{\n    Log.Warn($\"Missing data node: {ex.Message}\");\n    return defaultValue;\n}","preventionTips":["Define node paths as constants shared by writer and reader","Check HasData before GetData in non-critical paths","Ensure node trees are created during initialization before readers run","Log node.FullName on failure to diagnose path mismatches","Verify removed nodes are not queried after scene transitions"],"tags":["datanode","gameframework","node-not-found"],"backgroundTag":"resource-not-found","analyzedSha":"d0c010b05167c58e92350449d04864a91ca13fd2","analyzedAt":"2026-09-15T13:37:15.352Z","contentChangedAt":"2026-09-15T13:37:15.352Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}