chore(emqx_mgmt_api_listeners): return error tuple

This commit is contained in:
z8674558 2021-03-01 12:55:09 +09:00 committed by tigercl
parent 4b43b6532c
commit c52d241a06
1 changed files with 1 additions and 1 deletions

View File

@ -65,7 +65,7 @@ restart(#{identifier := Identifier}, _Params) ->
Results = [{Node, emqx_mgmt:restart_listener(Node, Identifier)} || {Node, _Info} <- emqx_mgmt:list_nodes()], Results = [{Node, emqx_mgmt:restart_listener(Node, Identifier)} || {Node, _Info} <- emqx_mgmt:list_nodes()],
case lists:filter(fun({_, Result}) -> Result =/= ok end, Results) of case lists:filter(fun({_, Result}) -> Result =/= ok end, Results) of
[] -> return(ok); [] -> return(ok);
Errors -> return({error, Errors}) Errors -> return({error, {restart, Errors}})
end. end.
format(Listeners) when is_list(Listeners) -> format(Listeners) when is_list(Listeners) ->