EllanJiang/GameFramework · error · GameFrameworkException
Full path is invalid.
Error message
Full path is invalid.
What it means
FileSystemManager.HasFileSystem looks up the file system registry keyed by a regularized full path. A null or empty fullPath cannot be a valid key, so the manager throws 'Full path is invalid.' before the lookup.
Solutions
- Validate fullPath is non-null and non-empty before calling HasFileSystem.
- Fix the config or code path that produced the empty full path.
- Normalize the path with Utility.Path.GetRegularPath if building it manually.
Example fix
// before
bool exists = fileSystemManager.HasFileSystem(fullPath); // may be empty
// after
if (!string.IsNullOrEmpty(fullPath))
bool exists = fileSystemManager.HasFileSystem(fullPath); Defensive patterns
Strategy: validation
Validate before calling
if (string.IsNullOrEmpty(fullPath))
throw new ArgumentException("Full path must be non-empty.", nameof(fullPath)); Type guard
static bool IsValidFullPath(string fullPath) => !string.IsNullOrEmpty(fullPath);
Try / catch
try { return fileSystemManager.HasFileSystem(fullPath); }
catch (GameFrameworkException ex) when (ex.Message == "Full path is invalid.") { return false; /* treat as absent after logging */ } Prevention
- Resolve all file system paths from one config/persistent-path helper that guarantees non-empty output.
- Normalize paths with Utility.Path.GetRegularPath before use.
- Fail at configuration load time if a required path key is missing.
When it happens
Trigger: Calling FileSystemManager.HasFileSystem(null) or HasFileSystem("").
Common situations: A path built from missing config values, an unset scene/level path, or string concatenation yielding an empty result before the existence check.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- Data string is invalid.
- Data bytes is invalid.
- Full path is invalid.
- Stream is invalid.
- Results is invalid.
AI-assisted analysis of EllanJiang/GameFramework@d0c010b051 (2026-09-15).
Data as JSON: /api/errors/d04a12ca802fe6f3.
Report an issue: GitHub.
Appendix: source
Thrown at GameFramework/FileSystem/FileSystemManager.cs:102
{
if (fileSystemHelper == null)
{
throw new GameFrameworkException("File system helper is invalid.");
}
m_FileSystemHelper = fileSystemHelper;
}
/// <summary>
/// 检查是否存在文件系统。
/// </summary>
/// <param name="fullPath">要检查的文件系统的完整路径。</param>
/// <returns>是否存在文件系统。</returns>
public bool HasFileSystem(string fullPath)
{
if (string.IsNullOrEmpty(fullPath))
{
throw new GameFrameworkException("Full path is invalid.");
}
return m_FileSystems.ContainsKey(Utility.Path.GetRegularPath(fullPath));
}
/// <summary>
/// 获取文件系统。
/// </summary>
/// <param name="fullPath">要获取的文件系统的完整路径。</param>
/// <returns>获取的文件系统。</returns>
public IFileSystem GetFileSystem(string fullPath)
{
if (string.IsNullOrEmpty(fullPath))
{
throw new GameFrameworkException("Full path is invalid.");
}
FileSystem fileSystem = null;View on GitHub (pinned to d0c010b051)