diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_policy.erl | 5 | ||||
| -rw-r--r-- | src/rabbit_runtime_parameters.erl | 8 |
2 files changed, 9 insertions, 4 deletions
diff --git a/src/rabbit_policy.erl b/src/rabbit_policy.erl index cf65665874..3d8851369e 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 b29cddcc45..4a3be9ffae 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, [return_maps]) 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, [return_maps]) 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) -> |
