From d60d72d7bfeba16eb061365183f11fabbaac2f32 Mon Sep 17 00:00:00 2001 From: Evgeny Khramtsov Date: Wed, 19 Sep 2018 01:00:50 +0300 Subject: Don't hide 'undef' exceptions during config validation --- src/ejabberd_config.erl | 2 +- src/ejabberd_listener.erl | 2 +- src/gen_mod.erl | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ejabberd_config.erl b/src/ejabberd_config.erl index d1e7a2f45..48fdcefbc 100644 --- a/src/ejabberd_config.erl +++ b/src/ejabberd_config.erl @@ -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})]), diff --git a/src/ejabberd_listener.erl b/src/ejabberd_listener.erl index 5b2981c2d..7c3d9e31e 100644 --- a/src/ejabberd_listener.erl +++ b/src/ejabberd_listener.erl @@ -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) diff --git a/src/gen_mod.erl b/src/gen_mod.erl index 6575e1e82..cf107f7b0 100644 --- a/src/gen_mod.erl +++ b/src/gen_mod.erl @@ -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. -- cgit v1.2.3