Do not ignore unknown options so far

This commit is contained in:
Evgeniy Khramtsov 2015-06-03 16:21:07 +03:00
parent c1119b1f39
commit 9a9633dbc5
2 changed files with 7 additions and 5 deletions

View File

@ -749,8 +749,9 @@ validate_opts(#state{opts = Opts} = State) ->
true
end;
_ ->
?ERROR_MSG("ignoring uknown option '~s'", [Opt]),
false
?ERROR_MSG("unknown option '~s' will be likely"
" ignored", [Opt]),
true
end
end, Opts),
State#state{opts = NewOpts}.

View File

@ -248,9 +248,10 @@ validate_opts(Module, Opts) ->
end;
L when is_list(L) ->
SOpts = str:join([[$', atom_to_list(A), $'] || A <- L], <<", ">>),
?ERROR_MSG("ignoring unknown option '~s' for module '~s',"
" available options are: ~s", [Opt, Module, SOpts]),
false;
?ERROR_MSG("unknown option '~s' for module '~s' will be"
" likely ignored, available options are: ~s",
[Opt, Module, SOpts]),
true;
{'EXIT', {undef, _}} ->
?WARNING_MSG("module '~s' doesn't export mod_opt_type/1",
[Module]),