mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-24 16:23:40 +01:00
Don't hide 'undef' exceptions during config validation
This commit is contained in:
parent
7ff5f2d3fa
commit
d60d72d7bf
@ -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})]),
|
||||||
|
@ -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)
|
||||||
|
@ -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.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user