25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-22 16:20:52 +01:00

Don't hide 'undef' exceptions during config validation

This commit is contained in:
Evgeny Khramtsov 2018-09-19 01:00:50 +03:00
parent 7ff5f2d3fa
commit d60d72d7bf
3 changed files with 3 additions and 3 deletions

View File

@ -1083,7 +1083,7 @@ validate_opts(#state{opts = Opts} = State, ModOpts) ->
[Opt, Error, [Opt, Error,
misc:format_val({yaml, Val})]), misc:format_val({yaml, Val})]),
erlang:error(invalid_option); erlang:error(invalid_option);
_:_ -> _:R when R /= undef ->
?ERROR_MSG("Invalid value for " ?ERROR_MSG("Invalid value for "
"option '~s': ~s", "option '~s': ~s",
[Opt, misc:format_val({yaml, Val})]), [Opt, misc:format_val({yaml, Val})]),

View File

@ -586,7 +586,7 @@ validate_module_opt(Module, Opt, Val) ->
catch _:_ -> listen_opt_type(Opt) catch _:_ -> listen_opt_type(Opt)
end, end,
try {Opt, VFun(Val)} try {Opt, VFun(Val)}
catch _:_ -> catch _:R when R /= undef ->
?ERROR_MSG("Invalid value of listening option ~s: ~s", ?ERROR_MSG("Invalid value of listening option ~s: ~s",
[Opt, misc:format_val({yaml, Val})]), [Opt, misc:format_val({yaml, Val})]),
erlang:error(badarg) erlang:error(badarg)

View File

@ -620,7 +620,7 @@ validate_opt(Opt, Val, VFun) ->
NewVal -> [{Opt, NewVal}] NewVal -> [{Opt, NewVal}]
catch {invalid_syntax, Error} -> catch {invalid_syntax, Error} ->
err_invalid_option(Opt, Val, Error); err_invalid_option(Opt, Val, Error);
_:_ -> _:R when R /= undef ->
err_invalid_option(Opt, Val) err_invalid_option(Opt, Val)
end. end.