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} ->
|
||||
#{<<"file">> => Filename};
|
||||
{error, Reason} ->
|
||||
error(Reason)
|
||||
erlang:throw(Reason)
|
||||
end;
|
||||
{error, Reason} ->
|
||||
error({invalid_license_file, Reason})
|
||||
erlang:throw({invalid_license_file, Reason})
|
||||
end;
|
||||
|
||||
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} ->
|
||||
#{<<"key">> => Content};
|
||||
{error, Reason} ->
|
||||
?SLOG(error, #{msg => "failed_to_parse_license", reason => Reason}),
|
||||
error(Reason)
|
||||
erlang:throw(Reason)
|
||||
end.
|
||||
|
||||
check_max_clients_exceeded(MaxClients) ->
|
||||
|
|
Loading…
Reference in New Issue