{"record":{"id":"bec31b9d4198aaa8","repo":"EllanJiang/GameFramework","slug":"check-resources-0-error-with-unknown-status","errorCode":null,"errorMessage":"Check resources '{0}' error with unknown status.","messagePattern":"Check resources '(.+?)' error with unknown status\\.","errorType":"exception","errorClass":"GameFrameworkException","httpStatus":null,"severity":"error","filePath":"GameFramework/Resource/ResourceManager.ResourceChecker.cs","lineNumber":195,"sourceCode":"                    }\n                    else if (ci.Status == CheckInfo.CheckStatus.Update)\n                    {\n                        m_ResourceManager.m_ResourceInfos.Add(ci.ResourceName, new ResourceInfo(ci.ResourceName, ci.FileSystemName, ci.LoadType, ci.Length, ci.HashCode, ci.CompressedLength, false, false));\n                        updateCount++;\n                        updateTotalLength += ci.Length;\n                        updateTotalCompressedLength += ci.CompressedLength;\n                        if (ResourceNeedUpdate != null)\n                        {\n                            ResourceNeedUpdate(ci.ResourceName, ci.FileSystemName, ci.LoadType, ci.Length, ci.HashCode, ci.CompressedLength, ci.CompressedHashCode);\n                        }\n                    }\n                    else if (ci.Status == CheckInfo.CheckStatus.Unavailable || ci.Status == CheckInfo.CheckStatus.Disuse)\n                    {\n                        // Do nothing.\n                    }\n                    else\n                    {\n                        throw new GameFrameworkException(Utility.Text.Format(\"Check resources '{0}' error with unknown status.\", ci.ResourceName.FullName));\n                    }\n\n                    if (ci.NeedRemove)\n                    {\n                        removedCount++;\n                        if (ci.ReadWriteUseFileSystem)\n                        {\n                            IFileSystem fileSystem = m_ResourceManager.GetFileSystem(ci.ReadWriteFileSystemName, false);\n                            fileSystem.DeleteFile(ci.ResourceName.FullName);\n                        }\n                        else\n                        {\n                            string resourcePath = Utility.Path.GetRegularPath(Path.Combine(m_ResourceManager.m_ReadWritePath, ci.ResourceName.FullName));\n                            if (File.Exists(resourcePath))\n                            {\n                                File.Delete(resourcePath);\n                            }\n                        }","sourceCodeStart":177,"sourceCodeEnd":213,"githubUrl":"https://github.com/EllanJiang/GameFramework/blob/d0c010b05167c58e92350449d04864a91ca13fd2/GameFramework/Resource/ResourceManager.ResourceChecker.cs#L177-L213","documentation":"RefreshCheckInfoStatus switches on CheckInfo.CheckStatus after refreshing each resource's status. All expected statuses (StorageInReadOnly, StorageInReadWrite, Update, Unavailable, Disuse) are handled; any other value falls into the else branch and throws this GameFrameworkException naming the resource. This is an internal invariant — CheckStatus should never hold another value.","triggerScenarios":"A CheckInfo.Status value outside the enumerated expected set after ci.RefreshStatus(...) — practically unreachable unless CheckStatus was extended with new enum members or memory/state corruption leaves an uninitialized status.","commonSituations":"Custom modifications of the framework adding a new CheckStatus value without updating RefreshCheckInfoStatus; debugging builds that tamper with check state; never seen in stock GameFramework.","solutions":["Log ci.Status for the offending resource and check whether the enum was extended by custom code.","If CheckStatus was extended, add a handler branch for the new value in RefreshCheckInfoStatus.","Otherwise treat it as state corruption: clear ReadWritePath/version lists and rerun the resource check."],"exampleFix":"// before: new enum value with no branch\nelse\n{\n    throw new GameFrameworkException(...unknown status...);\n}\n\n// after\nelse if (ci.Status == CheckInfo.CheckStatus.MyNewStatus)\n{\n    // handle the new status\n}\nelse\n{\n    throw new GameFrameworkException(...);\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":"static bool IsKnownStatus(ResourceCheckerCheckStatus s) =>\n    s == CheckStatus.StorageInReadOnly || s == CheckStatus.StorageInReadWrite ||\n    s == CheckStatus.Update || s == CheckStatus.Unavailable || s == CheckStatus.Disuse;","tryCatchPattern":"try { m_ResourceComponent.CheckResources(); }\ncatch (GameFrameworkException ex) when (ex.Message.Contains(\"unknown status\"))\n{\n    Debug.LogError($\"CheckStatus invariant broken: {ex.Message}\");\n}","preventionTips":["If you extend CheckStatus, update RefreshCheckInfoStatus in the same change.","Do not modify framework internals without reviewing every switch on the enum.","Reset the read-write area if check state appears corrupted."],"tags":["gameframework","resource","enum","invariant-violation"],"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"}