mirror of
https://github.com/processone/ejabberd
synced 2025-10-03 17:59:31 +02:00
Provide a suggestion when unknown module is detected
This commit is contained in:
parent
39bbc7cad8
commit
c56209a27d
2 changed files with 7 additions and 3 deletions
|
@ -39,7 +39,7 @@
|
||||||
default_queue_type/1, queue_dir/0, fsm_limit_opts/1,
|
default_queue_type/1, queue_dir/0, fsm_limit_opts/1,
|
||||||
use_cache/1, cache_size/1, cache_missed/1, cache_life_time/1,
|
use_cache/1, cache_size/1, cache_missed/1, cache_life_time/1,
|
||||||
codec_options/1, get_plain_terms_file/2, negotiation_timeout/0,
|
codec_options/1, get_plain_terms_file/2, negotiation_timeout/0,
|
||||||
similar_option/2]).
|
similar_option/2, get_modules/0]).
|
||||||
|
|
||||||
-export([start/2]).
|
-export([start/2]).
|
||||||
|
|
||||||
|
|
|
@ -740,11 +740,15 @@ format_module_error(Module, Fun, Arity, Opts, Class, Reason, St) ->
|
||||||
IsCallbackExported = erlang:function_exported(Module, Fun, Arity),
|
IsCallbackExported = erlang:function_exported(Module, Fun, Arity),
|
||||||
case {Class, Reason} of
|
case {Class, Reason} of
|
||||||
{error, undef} when not IsLoaded ->
|
{error, undef} when not IsLoaded ->
|
||||||
io_lib:format("Failed to ~s unknown module ~s: "
|
io_lib:format("Failed to ~s unknown module ~s, "
|
||||||
|
"did you mean ~s? Hint: "
|
||||||
"make sure there is no typo and ~s.beam "
|
"make sure there is no typo and ~s.beam "
|
||||||
"exists inside either ~s or ~s "
|
"exists inside either ~s or ~s "
|
||||||
"directory",
|
"directory",
|
||||||
[Fun, Module, Module,
|
[Fun, Module,
|
||||||
|
ejabberd_config:similar_option(
|
||||||
|
Module, ejabberd_config:get_modules()),
|
||||||
|
Module,
|
||||||
filename:dirname(code:which(?MODULE)),
|
filename:dirname(code:which(?MODULE)),
|
||||||
ext_mod:modules_dir()]);
|
ext_mod:modules_dir()]);
|
||||||
{error, undef} when not IsCallbackExported ->
|
{error, undef} when not IsCallbackExported ->
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue