fix(gw): fix the bad return value for initiating chain

This commit is contained in:
JianBo He 2021-08-17 14:41:21 +08:00
parent 430f20adc1
commit b8cb31c0ff
1 changed files with 4 additions and 4 deletions

View File

@ -232,9 +232,9 @@ create_authenticators_for_gateway_insta(GwName, AuthCfgs) ->
NResults /= [] andalso begin NResults /= [] andalso begin
logger:error("Failed to create authenticators: ~p", [NResults]), logger:error("Failed to create authenticators: ~p", [NResults]),
throw({bad_autheticators, NResults}) throw({bad_autheticators, NResults})
end, ok; end, ChainId;
{error, Reason} -> {error, Reason} ->
logger:error("Failed to create authenticator chain: ~p", [Reason]), logger:error("Failed to create authentication chain: ~p", [Reason]),
throw({bad_chain, {ChainId, Reason}}) throw({bad_chain, {ChainId, Reason}})
end. end.
@ -244,10 +244,10 @@ cleanup_authenticators_for_gateway_insta(ChainId) ->
case emqx_authn:delete_chain(ChainId) of case emqx_authn:delete_chain(ChainId) of
ok -> ok; ok -> ok;
{error, {not_found, _}} -> {error, {not_found, _}} ->
logger:warning("Failed to clean authenticator chain: ~s, " logger:warning("Failed to clean authentication chain: ~s, "
"reason: not_found", [ChainId]); "reason: not_found", [ChainId]);
{error, Reason} -> {error, Reason} ->
logger:error("Failed to clean authenticator chain: ~s, " logger:error("Failed to clean authentication chain: ~s, "
"reason: ~p", [ChainId, Reason]) "reason: ~p", [ChainId, Reason])
end. end.