fix(APIs): clarify the error message when update listener failed
This commit is contained in:
parent
50ccaec4b0
commit
4da413c453
|
@ -507,8 +507,12 @@ update_listener(Id, Config) ->
|
||||||
|
|
||||||
update_listener(Node, Id, Config) when Node =:= node() ->
|
update_listener(Node, Id, Config) when Node =:= node() ->
|
||||||
{Type, Name} = emqx_listeners:parse_listener_id(Id),
|
{Type, Name} = emqx_listeners:parse_listener_id(Id),
|
||||||
{ok, #{raw_config := RawConf}} = emqx:update_config([listeners, Type, Name], Config, #{}),
|
case emqx:update_config([listeners, Type, Name], Config, #{}) of
|
||||||
RawConf#{node => Node, id => Id, running => true};
|
{ok, #{raw_config := RawConf}} ->
|
||||||
|
RawConf#{node => Node, id => Id, running => true};
|
||||||
|
{error, Reason} ->
|
||||||
|
error(Reason)
|
||||||
|
end;
|
||||||
update_listener(Node, Id, Config) ->
|
update_listener(Node, Id, Config) ->
|
||||||
rpc_call(Node, update_listener, [Node, Id, Config]).
|
rpc_call(Node, update_listener, [Node, Id, Config]).
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue