summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Klishin <michael@novemberain.com>2017-02-01 23:22:00 +0300
committerGitHub <noreply@github.com>2017-02-01 23:22:00 +0300
commitaf7150ed7f943bb75ba3b6f7d46d443c0e0801db (patch)
tree1bac448d2d816f297b0d4a6e2c2692b6bfb69ce3 /src
parent22a756fd8c10f317590a43754548df3192cf3701 (diff)
parent288ab084198212282d419eb78ccfd91c1c4108b6 (diff)
downloadrabbitmq-server-git-af7150ed7f943bb75ba3b6f7d46d443c0e0801db.tar.gz
Merge pull request #1089 from rabbitmq/rabbitmq-common-164
Change the calls that uses the rabbit_json module
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_policy.erl5
-rw-r--r--src/rabbit_runtime_parameters.erl8
-rw-r--r--src/rabbit_vhost_limit.erl5
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) ->