From bbffd396f622fbc598a904531f980c960ad51e20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Chmielowski?= Date: Wed, 30 Jan 2019 16:35:06 +0100 Subject: [PATCH] Produce better error for http_api request with extra parameters --- src/mod_http_api.erl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mod_http_api.erl b/src/mod_http_api.erl index 7a4c73315..8cc80982a 100644 --- a/src/mod_http_api.erl +++ b/src/mod_http_api.erl @@ -357,7 +357,10 @@ format_args(Args, ArgsFormat) -> {Args, []}, ArgsFormat), case ArgsRemaining of [] -> 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. format_arg({Elements},