Report meaningful error when luerl is not available
This commit is contained in:
parent
b1ecd8ac01
commit
8962397cf3
|
@ -38,23 +38,30 @@
|
||||||
%%% API
|
%%% API
|
||||||
%%%===================================================================
|
%%%===================================================================
|
||||||
from_dir(ProsodyDir) ->
|
from_dir(ProsodyDir) ->
|
||||||
case file:list_dir(ProsodyDir) of
|
case code:ensure_loaded(luerl) of
|
||||||
{ok, HostDirs} ->
|
{module, _} ->
|
||||||
lists:foreach(
|
case file:list_dir(ProsodyDir) of
|
||||||
fun(HostDir) ->
|
{ok, HostDirs} ->
|
||||||
Host = list_to_binary(HostDir),
|
lists:foreach(
|
||||||
lists:foreach(
|
fun(HostDir) ->
|
||||||
fun(SubDir) ->
|
Host = list_to_binary(HostDir),
|
||||||
Path = filename:join(
|
lists:foreach(
|
||||||
[ProsodyDir, HostDir, SubDir]),
|
fun(SubDir) ->
|
||||||
convert_dir(Path, Host, SubDir)
|
Path = filename:join(
|
||||||
end, ["vcard", "accounts", "roster",
|
[ProsodyDir, HostDir, SubDir]),
|
||||||
"private", "config", "offline",
|
convert_dir(Path, Host, SubDir)
|
||||||
"privacy", "pep", "pubsub"])
|
end, ["vcard", "accounts", "roster",
|
||||||
end, HostDirs);
|
"private", "config", "offline",
|
||||||
{error, Why} = Err ->
|
"privacy", "pep", "pubsub"])
|
||||||
?ERROR_MSG("failed to list ~s: ~s",
|
end, HostDirs);
|
||||||
[ProsodyDir, file:format_error(Why)]),
|
{error, Why} = Err ->
|
||||||
|
?ERROR_MSG("failed to list ~s: ~s",
|
||||||
|
[ProsodyDir, file:format_error(Why)]),
|
||||||
|
Err
|
||||||
|
end;
|
||||||
|
{error, _} = Err ->
|
||||||
|
?INFO_MSG("The file 'luerl.beam' is not found: maybe "
|
||||||
|
"ejabberd is not compiled with Lua support", []),
|
||||||
Err
|
Err
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue