Skip to content

Commit

Permalink
fixed: ctrl+c to break will get bagarg when staring observer_cli by rpc
Browse files Browse the repository at this point in the history
[{erlang,'--',[{error,terminated},"\n"],[]},{observer_cli_lib,parse_integer,1,[{file,"observer_cli_lib.erl"},{line,387}]},{observer_cli,manager,4,[{file,"observer_cli.erl"},{line,101}]},{emqx_ctl,run_command,2,[{file,"emqx_ctl.erl"},{line,104}]},{erpc,execute_call,4,[{file,"erpc.erl"},{line,416}]}]
  • Loading branch information
zhongwencool committed Aug 27, 2021
1 parent 3ee9ff0 commit 17a4601
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/observer_cli_lib.erl
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,9 @@ parse_cmd(ViewOpts, Module, Args) ->
hide;
"`\n" ->
scheduler_usage;
%% {error, estale}|{error, terminated}
{error, _Reason} ->
quit;
Number ->
parse_integer(Number)
end.
Expand Down
2 changes: 2 additions & 0 deletions src/observer_cli_plugin.erl
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,8 @@ parse_cmd() ->
"F\n" -> page_down_top_n;
"q\n" -> quit;
"\n" -> jump;
%% {error, estale}|{error, terminated}
{error, _Reason} -> quit;
Number -> observer_cli_lib:parse_integer(Number)
end.

Expand Down
3 changes: 3 additions & 0 deletions src/observer_cli_process.erl
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,9 @@ parse_cmd() ->
home;
"B\n" ->
back;
%% {error, estale}|{error, terminated}
{error, _Reason} ->
quit;
Number ->
observer_cli_lib:parse_integer(Number)
end.
Expand Down

0 comments on commit 17a4601

Please sign in to comment.