fix(emqx_license): raise throw exception instead of error
This commit is contained in:
parent
cd3565d357
commit
fc8eeb8819
|
@ -118,10 +118,10 @@ do_update({file, Filename}, _Conf) ->
|
||||||
{ok, _License} ->
|
{ok, _License} ->
|
||||||
#{<<"file">> => Filename};
|
#{<<"file">> => Filename};
|
||||||
{error, Reason} ->
|
{error, Reason} ->
|
||||||
error(Reason)
|
erlang:throw(Reason)
|
||||||
end;
|
end;
|
||||||
{error, Reason} ->
|
{error, Reason} ->
|
||||||
error({invalid_license_file, Reason})
|
erlang:throw({invalid_license_file, Reason})
|
||||||
end;
|
end;
|
||||||
|
|
||||||
do_update({key, Content}, _Conf) when is_binary(Content); is_list(Content) ->
|
do_update({key, Content}, _Conf) when is_binary(Content); is_list(Content) ->
|
||||||
|
@ -129,8 +129,7 @@ do_update({key, Content}, _Conf) when is_binary(Content); is_list(Content) ->
|
||||||
{ok, _License} ->
|
{ok, _License} ->
|
||||||
#{<<"key">> => Content};
|
#{<<"key">> => Content};
|
||||||
{error, Reason} ->
|
{error, Reason} ->
|
||||||
?SLOG(error, #{msg => "failed_to_parse_license", reason => Reason}),
|
erlang:throw(Reason)
|
||||||
error(Reason)
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
check_max_clients_exceeded(MaxClients) ->
|
check_max_clients_exceeded(MaxClients) ->
|
||||||
|
|
Loading…
Reference in New Issue