25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-20 17:27:00 +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,
misc:format_val({yaml, Val})]),
erlang:error(invalid_option);
_:_ ->
_:R when R /= undef ->
?ERROR_MSG("Invalid value for "
"option '~s': ~s",
[Opt, misc:format_val({yaml, Val})]),

View File

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

View File

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