26
1
mirror of https://github.com/processone/ejabberd.git synced 2025-01-03 18:02:28 +01:00

Produce better error for http_api request with extra parameters

This commit is contained in:
Paweł Chmielowski 2019-01-30 16:35:06 +01:00
parent 56baa07d48
commit bbffd396f6

View File

@ -357,7 +357,10 @@ format_args(Args, ArgsFormat) ->
{Args, []}, ArgsFormat), {Args, []}, ArgsFormat),
case ArgsRemaining of case ArgsRemaining of
[] -> R; [] -> R;
L when is_list(L) -> exit({additional_unused_args, L}) L when is_list(L) ->
throw({invalid_parameter,
io_lib:format("Request have unknown arguments: ~w",
[[N || {N, _} <- L]])})
end. end.
format_arg({Elements}, format_arg({Elements},