EllanJiang/GameFramework · error · GameFrameworkException
Debugger window has been registered.
Error message
Debugger window has been registered.
What it means
DebuggerWindowGroup.RegisterDebuggerWindow throws this when a leaf path (no further '/' segments) is already occupied by an existing debugger window. The group stores windows keyed by path and forbids duplicate registrations at the same path. Note the same exception text can also surface from the manager-level wrapper when re-registering.
Solutions
- Check HasDebuggerWindow(path) before registering, or unregister the existing window first.
- Use a unique path for each window type.
- Guard initialization code so it runs only once.
Example fix
// before
debugger.RegisterDebuggerWindow("System/MyWindow", new MyWindow());
// after
if (!debugger.HasDebuggerWindow("System/MyWindow"))
debugger.RegisterDebuggerWindow("System/MyWindow", new MyWindow()); Defensive patterns
Strategy: validation
Validate before calling
if (debugger.HasDebuggerWindow(path)) debugger.UnregisterDebuggerWindow(path);
Try / catch
try { debugger.RegisterDebuggerWindow(path, window); }
catch (GameFrameworkException) { Log.Warning($"Debugger window '{path}' already registered"); } Prevention
- Call HasDebuggerWindow before every registration
- Make registration idempotent (check-then-register)
- Guard init code against double execution (domain reload, duplicate Awake)
When it happens
Trigger: Calling RegisterDebuggerWindow("Procedures/ProcedureOverview") twice without unregistering; re-registering after a domain reload or debugger restart; two different window classes registered under the same path.
Common situations: Initialization code running twice (duplicate component init); accidentally reusing a path string for a new window; hot-reload scenarios re-running registration code.
Understand the failure class
Background: "already exists" / EEXIST / FileAlreadyExistsException: what the 'file already exists' error means and how to fix it — this error's family across 37 libraries.
Related errors
- Debugger window is invalid.
- Owner is invalid.
- Resource manager is invalid.
- Data provider helper is invalid.
- Type is invalid.
AI-assisted analysis of EllanJiang/GameFramework@d0c010b051 (2026-09-15).
Data as JSON: /api/errors/7393a6310ea4134a.
Report an issue: GitHub.
Appendix: source
Thrown at GameFramework/Debugger/DebuggerManager.DebuggerWindowGroup.cs:219
/// <summary>
/// 注册调试器窗口。
/// </summary>
/// <param name="path">调试器窗口路径。</param>
/// <param name="debuggerWindow">要注册的调试器窗口。</param>
public void RegisterDebuggerWindow(string path, IDebuggerWindow debuggerWindow)
{
if (string.IsNullOrEmpty(path))
{
throw new GameFrameworkException("Path is invalid.");
}
int pos = path.IndexOf('/');
if (pos < 0 || pos >= path.Length - 1)
{
if (InternalGetDebuggerWindow(path) != null)
{
throw new GameFrameworkException("Debugger window has been registered.");
}
m_DebuggerWindows.Add(new KeyValuePair<string, IDebuggerWindow>(path, debuggerWindow));
RefreshDebuggerWindowNames();
}
else
{
string debuggerWindowGroupName = path.Substring(0, pos);
string leftPath = path.Substring(pos + 1);
DebuggerWindowGroup debuggerWindowGroup = (DebuggerWindowGroup)InternalGetDebuggerWindow(debuggerWindowGroupName);
if (debuggerWindowGroup == null)
{
if (InternalGetDebuggerWindow(debuggerWindowGroupName) != null)
{
throw new GameFrameworkException("Debugger window has been registered, can not create debugger window group.");
}
debuggerWindowGroup = new DebuggerWindowGroup();View on GitHub (pinned to d0c010b051)