EllanJiang/GameFramework · error · GameFrameworkException

Path is invalid.

Error message

Path is invalid.

What it means

DebuggerManager.RegisterDebuggerWindow(path, window, args) throws this when the path string is null or empty before delegating to the root group. Debugger paths are the lookup keys for the window tree, so they must be non-empty. This is the first of several guards in the registration flow.

Solutions

  1. Supply a non-empty hierarchical path such as "Common/MyWindow".
  2. Validate the path with string.IsNullOrEmpty before calling.
  3. Centralize debugger path constants so they cannot be empty.

Example fix

// before
debugger.RegisterDebuggerWindow(windowPath, new MyWindow());
// after
if (string.IsNullOrEmpty(windowPath)) windowPath = "Custom/MyWindow";
debugger.RegisterDebuggerWindow(windowPath, new MyWindow());
Defensive patterns

Strategy: validation

Validate before calling

if (string.IsNullOrEmpty(path)) throw new ArgumentException("Debugger path required");

Type guard

static bool IsValidDebuggerPath(string p) => !string.IsNullOrEmpty(p);

Try / catch

try { debugger.RegisterDebuggerWindow(path, window, args); }
catch (GameFrameworkException ex) { Log.Error($"Debugger window registration failed: {ex.Message}"); }

Prevention

When it happens

Trigger: Calling RegisterDebuggerWindow(null, window) or ("", window); passing a path built from an empty config entry or missing constant; constructing paths with string interpolation of unset variables.

Common situations: Inspector/config fields left blank; typos where the path variable is shadowed by an uninitialized field; refactoring that dropped the path argument.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


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

Appendix: source

Thrown at GameFramework/Debugger/DebuggerManager.cs:99

        /// 关闭并清理调试器管理器。
        /// </summary>
        internal override void Shutdown()
        {
            m_ActiveWindow = false;
            m_DebuggerWindowRoot.Shutdown();
        }

        /// <summary>
        /// 注册调试器窗口。
        /// </summary>
        /// <param name="path">调试器窗口路径。</param>
        /// <param name="debuggerWindow">要注册的调试器窗口。</param>
        /// <param name="args">初始化调试器窗口参数。</param>
        public void RegisterDebuggerWindow(string path, IDebuggerWindow debuggerWindow, params object[] args)
        {
            if (string.IsNullOrEmpty(path))
            {
                throw new GameFrameworkException("Path is invalid.");
            }

            if (debuggerWindow == null)
            {
                throw new GameFrameworkException("Debugger window is invalid.");
            }

            m_DebuggerWindowRoot.RegisterDebuggerWindow(path, debuggerWindow);
            debuggerWindow.Initialize(args);
        }

        /// <summary>
        /// 解除注册调试器窗口。
        /// </summary>
        /// <param name="path">调试器窗口路径。</param>
        /// <returns>是否解除注册调试器窗口成功。</returns>
        public bool UnregisterDebuggerWindow(string path)
        {

View on GitHub (pinned to d0c010b051)