{"record":{"id":"eee36d3e29669ba1","repo":"EllanJiang/GameFramework","slug":"data-asset-0-is-1","errorCode":null,"errorMessage":"Data asset '{0}' is '{1}'.","messagePattern":"Data asset '(.+?)' is '(.+?)'\\.","errorType":"exception","errorClass":"GameFrameworkException","httpStatus":null,"severity":"error","filePath":"GameFramework/Base/DataProvider/DataProvider.cs","lineNumber":244,"sourceCode":"                        }\n                    }\n                    catch (Exception exception)\n                    {\n                        if (m_ReadDataFailureEventHandler != null)\n                        {\n                            ReadDataFailureEventArgs loadDataFailureEventArgs = ReadDataFailureEventArgs.Create(dataAssetName, exception.ToString(), userData);\n                            m_ReadDataFailureEventHandler(this, loadDataFailureEventArgs);\n                            ReferencePool.Release(loadDataFailureEventArgs);\n                            return;\n                        }\n\n                        throw;\n                    }\n\n                    break;\n\n                default:\n                    throw new GameFrameworkException(Utility.Text.Format(\"Data asset '{0}' is '{1}'.\", dataAssetName, result));\n            }\n        }\n\n        /// <summary>\n        /// 解析内容。\n        /// </summary>\n        /// <param name=\"dataString\">要解析的内容字符串。</param>\n        /// <returns>是否解析内容成功。</returns>\n        public bool ParseData(string dataString)\n        {\n            return ParseData(dataString, null);\n        }\n\n        /// <summary>\n        /// 解析内容。\n        /// </summary>\n        /// <param name=\"dataString\">要解析的内容字符串。</param>\n        /// <param name=\"userData\">用户自定义数据。</param>","sourceCodeStart":226,"sourceCodeEnd":262,"githubUrl":"https://github.com/EllanJiang/GameFramework/blob/d0c010b05167c58e92350449d04864a91ca13fd2/GameFramework/Base/DataProvider/DataProvider.cs#L226-L262","documentation":"ReadData queries m_ResourceManager.HasAsset and switches on the HasAssetResult. Known cases (AssetOnDisk, BinaryOnFileSystem, etc.) are handled; any other result value falls into the default branch and throws this exception, reporting the asset name and the unexpected result value. It signals the resource manager returned a result the data provider does not know how to handle.","triggerScenarios":"HasAsset(dataAssetName) returns an enum value outside the cases handled by ReadData — e.g. HasAssetResult.Unknown or a value added in a newer GameFramework version while DataProvider's switch was not updated.","commonSituations":"Assemblies or framework files from mismatched GameFramework versions (ResourceManager updated, DataProvider not); asset genuinely missing/unverifiable so the resource manager reports an 'unknown' state; typo in asset name causing a not-found-style result.","solutions":["Log the reported result value from the exception message and confirm its meaning in HasAssetResult.","Check the data asset name/path is correct and the asset exists in the current resource package.","Synchronize ResourceManager and DataProvider source to the same GameFramework version.","Re-export/refresh the resource package so the asset resolves to a known state."],"exampleFix":"// before\ndataProvider.ReadData(\"Assets/typo-config.dat\", 0, null); // HasAssetResult.Unknown\n// after\ndataProvider.ReadData(\"Assets/Config/Config.dat\", 0, null); // correct asset path","handlingStrategy":"try-catch","validationCode":"if (m_ResourceManager.HasAsset(assetName) == HasAssetResult.Unknown) { /* fix asset path/package first */ }","typeGuard":null,"tryCatchPattern":"try { dataProvider.ReadData(name, 0, null); }\ncatch (GameFrameworkException e) when (e.Message.StartsWith(\"Data asset\")) { Log.Error(\"Unexpected HasAssetResult for '{0}': {1}\", name, e.Message); }","preventionTips":["Verify asset names/paths before loading.","Keep all GameFramework modules on the same version.","Refresh resource packages after content changes."],"tags":["unexpected-state","resource-loading","enum"],"backgroundTag":"invalid-enum-value","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"}