fix(emqx_plugin_libs_pool): throw error with Reason

This commit is contained in:
EMQ-YangM 2022-01-20 17:54:18 +08:00
parent f969bc2631
commit 78ca7f2521
1 changed files with 2 additions and 2 deletions

View File

@ -37,7 +37,7 @@ start_pool(Name, Mod, Options) ->
{error, Reason} -> {error, Reason} ->
?SLOG(error, #{msg => "start_ecpool_error", pool_name => Name, ?SLOG(error, #{msg => "start_ecpool_error", pool_name => Name,
reason => Reason}), reason => Reason}),
error({start_pool_failed, Name}) error({start_pool_failed, Name, Reason})
end. end.
stop_pool(Name) -> stop_pool(Name) ->
@ -49,7 +49,7 @@ stop_pool(Name) ->
{error, Reason} -> {error, Reason} ->
?SLOG(error, #{msg => "stop_ecpool_failed", pool_name => Name, ?SLOG(error, #{msg => "stop_ecpool_failed", pool_name => Name,
reason => Reason}), reason => Reason}),
error({stop_pool_failed, Name}) error({stop_pool_failed, Name, Reason})
end. end.
health_check(PoolName, CheckFunc, State) when is_function(CheckFunc) -> health_check(PoolName, CheckFunc, State) when is_function(CheckFunc) ->