egametang/ET · error · Exception
RemoveRobot error!
Error message
RemoveRobot error!
What it means
RemoveRobotConsoleHandler mirrors 315 for the RemoveRobot command: any WithNotParsed failure throws a generic 'RemoveRobot error!'. The empty-args case is handled separately and only logs.
Source
Thrown at Packages/cn.etetet.robot/Scripts/Hotfix/Server/RemoveRobotConsoleHandler.cs:26
public class RemoveRobotConsoleHandler: IConsoleHandler
{
public async ETTask Run(Fiber fiber, ModeContex contex, string content)
{
EntityRef<ModeContex> contexRef = contex;
try
{
switch (content)
{
case ConsoleMode.RemoveRobot:
{
Log.Console("RemoveRobot args error!");
break;
}
default:
{
RemoveRobotArgs options = null;
Parser.Default.ParseArguments<RemoveRobotArgs>(content.Split(' '))
.WithNotParsed(error => throw new Exception($"RemoveRobot error!"))
.WithParsed(o => { options = o; });
RobotManagerComponent robotManagerComponent = fiber.Root.GetComponent<RobotManagerComponent>();
if (robotManagerComponent == null)
{
Log.Console("RobotManagerComponent not found!");
return;
}
robotManagerComponent.GetRobotActorId(options.Account, out ActorId actorId);
ProcessInnerSender processInnerSender = fiber.Root.GetComponent<ProcessInnerSender>();
Console2Robot_LogoutRequest request = Console2Robot_LogoutRequest.Create();
Console2Robot_LogoutResponse response = await processInnerSender.Call(actorId.FiberInstanceId, request) as Console2Robot_LogoutResponse;
Log.Console($"Remove Robot OK: {options.Account}");
break;
}
}
}
finallyView on GitHub (pinned to 5cab01f7a8)
Solutions
- Invoke 'RemoveRobot' bare to see usage help.
- Inspect RemoveRobotArgs to learn required flags (likely --account).
- Re-issue with correctly typed arguments.
- Improve the handler to include parser errors in the message.
Example fix
// before: discards parse errors
.WithNotParsed(error => throw new Exception($"RemoveRobot error!"))
// after: include real errors
.WithNotParsed(error => throw new Exception($"RemoveRobot error: {string.Join(", ", error)}")) Defensive patterns
Strategy: try-catch
Validate before calling
// Validate required fields up front
if (string.IsNullOrWhiteSpace(account)) {
Log.Console("Usage: RemoveRobot --account <name>");
return;
} Try / catch
try { /* parse + remove */ }
catch (Exception e) when (e.Message.Contains("RemoveRobot error")) {
Log.Console($"Invalid RemoveRobot arguments. Usage: RemoveRobot --account <name>. Detail: {e.Message}");
} Prevention
- Inspect RemoveRobotArgs for the exact required flags.
- Include parser errors in the thrown message.
- Document the console command format where operators can see it.
When it happens
Trigger: Issuing 'RemoveRobot' with arguments that fail to bind to RemoveRobotArgs (e.g. missing --account, wrong type). WithNotParsed throws generically without the underlying error.
Common situations: Malformed RemoveRobot console input; RemoveRobotArgs schema changed (new required field); calling the command without the expected --account flag.
Related errors
- CreateRobotArgs error!
- ConsoleHandler handler not inherit IConsoleHandler class: {o
- RouterManager fiber not found under fiber: {self.Fiber().Nam
- RouterManagerAddressComponent is missing on RouterManager sc
AI-assisted analysis of egametang/ET@5cab01f7a8 (2026-08-13).
Data as JSON: /api/errors/1be914ee96aee68d.
Report an issue: GitHub.