diff options
| -rw-r--r-- | src/rabbit_policy.erl | 5 | ||||
| -rw-r--r-- | src/rabbit_runtime_parameters.erl | 8 | ||||
| -rw-r--r-- | src/rabbit_vhost_limit.erl | 5 |
3 files changed, 12 insertions, 6 deletions
diff --git a/src/rabbit_policy.erl b/src/rabbit_policy.erl index 4ab972872e..c4fbf1c830 100644 --- a/src/rabbit_policy.erl +++ b/src/rabbit_policy.erl @@ -223,8 +223,9 @@ parse_set0(Type, VHost, Name, Pattern, Defn, Priority, ApplyTo, ActingUser) -> {<<"priority">>, Priority}, {<<"apply-to">>, ApplyTo}], ActingUser); - error -> - {error_string, "JSON decoding error"} + {error, Reason} -> + {error_string, + rabbit_misc:format("JSON decoding error. Reason: ~ts", [Reason])} end. set_op(VHost, Name, Pattern, Definition, Priority, ApplyTo, ActingUser) -> diff --git a/src/rabbit_runtime_parameters.erl b/src/rabbit_runtime_parameters.erl index 7a320e108b..64442142da 100644 --- a/src/rabbit_runtime_parameters.erl +++ b/src/rabbit_runtime_parameters.erl @@ -108,7 +108,9 @@ parse_set(VHost, Component, Name, String, User) -> case rabbit_json:try_decode(Definition) of {ok, Term} when is_map(Term) -> set(VHost, Component, Name, maps:to_list(Term), User); {ok, Term} -> set(VHost, Component, Name, Term, User); - error -> {error_string, "JSON decoding error"} + {error, Reason} -> + {error_string, + rabbit_misc:format("JSON decoding error. Reason: ~ts", [Reason])} end. set(_, <<"policy">>, _, _, _) -> @@ -121,7 +123,9 @@ parse_set_global(Name, String, ActingUser) -> case rabbit_json:try_decode(Definition) of {ok, Term} when is_map(Term) -> set_global(Name, maps:to_list(Term), ActingUser); {ok, Term} -> set_global(Name, Term, ActingUser); - error -> {error_string, "JSON decoding error"} + {error, Reason} -> + {error_string, + rabbit_misc:format("JSON decoding error. Reason: ~ts", [Reason])} end. set_global(Name, Term, ActingUser) -> diff --git a/src/rabbit_vhost_limit.erl b/src/rabbit_vhost_limit.erl index b948a94668..d0c775f0bd 100644 --- a/src/rabbit_vhost_limit.erl +++ b/src/rabbit_vhost_limit.erl @@ -137,8 +137,9 @@ parse_set(VHost, Defn, ActingUser) -> case rabbit_json:try_decode(Definition) of {ok, Term} -> set(VHost, maps:to_list(Term), ActingUser); - error -> - {error_string, "JSON decoding error"} + {error, Reason} -> + {error_string, + rabbit_misc:format("JSON decoding error. Reason: ~ts", [Reason])} end. set(VHost, Defn, ActingUser) -> |
