Don't emit validator's warning if the module is not found

This commit is contained in:
Evgeniy Khramtsov 2018-02-19 22:07:09 +03:00
parent e070e6bccb
commit 06c480106f
1 changed files with 10 additions and 3 deletions

View File

@ -516,9 +516,16 @@ get_validators(Host, {Module, SubMods}) ->
[] ->
case have_validators(Module) of
false ->
?WARNING_MSG("Third-party module '~s' doesn't export "
"options validator; consider to upgrade "
"the module", [Module]),
case code:ensure_loaded(Module) of
{module, _} ->
?WARNING_MSG("Third-party module '~s' doesn't export "
"options validator; consider to upgrade "
"the module", [Module]);
_ ->
%% Silently ignore this, the error will be
%% generated later
ok
end,
undef;
true ->
[]