fix(api_keys): improved the error message when bootstrapping api_key

This commit is contained in:
firest 2024-06-25 19:22:10 +08:00
parent 14e2ed7be1
commit ac6bbd2977
1 changed files with 7 additions and 1 deletions

View File

@ -357,6 +357,11 @@ init_bootstrap_file(File) ->
init_bootstrap_file(File, Dev, MP); init_bootstrap_file(File, Dev, MP);
{error, Reason0} -> {error, Reason0} ->
Reason = emqx_utils:explain_posix(Reason0), Reason = emqx_utils:explain_posix(Reason0),
FmtReason = emqx_utils:format(
"load API bootstrap file failed, file:~ts, reason:~ts",
[File, Reason]
),
?SLOG( ?SLOG(
error, error,
#{ #{
@ -365,7 +370,8 @@ init_bootstrap_file(File) ->
reason => Reason reason => Reason
} }
), ),
{error, Reason}
{error, FmtReason}
end. end.
init_bootstrap_file(File, Dev, MP) -> init_bootstrap_file(File, Dev, MP) ->