[cli] prevent ot-ctl termination during debug command (#12600)

Under interactive mode, the `ot-ctl` client treats lines starting with
"Error" as fatal command failures. It exits immediately and stop
receiving CLI output. As the `debug` command runs a sequence of
sub-commands; if one fails , the entire debug session would stop.

This change modifies the error prefix to "ERROR" for internal debug
commands, allowing ot-ctl to continue processing subsequent output.
Also, it adds an explicit `OutputLine("Done")` at the end of the debug
command processing to ensure the CLI client correctly detects the end
of the command.
This commit is contained in:
Yang Song
2026-03-18 19:51:40 -05:00
committed by GitHub
parent 23caf33af5
commit aa2437a313
+3 -1
View File
@@ -164,7 +164,9 @@ void Interpreter::OutputResult(otError aError)
{
if (aError != OT_ERROR_NONE)
{
OutputLine("Error %u: %s", aError, otThreadErrorToString(aError));
// For internal debug commands, prepending `*` to prevent cli client from treating this as a fatal error and
// exit.
OutputLine("* Error %u: %s", aError, otThreadErrorToString(aError));
}
ExitNow();