We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6429f80 commit 1788899Copy full SHA for 1788899
src/rabbit_policy.erl
@@ -468,6 +468,9 @@ validation(Name, Terms) ->
468
469
validation(_Name, [], _Validator) ->
470
{error, "no policy provided", []};
471
+validation(Name, Terms0, Validator) when is_map(Terms0) ->
472
+ Terms = maps:to_list(Terms0),
473
+ validation(Name, Terms, Validator);
474
validation(_Name, Terms, Validator) when is_list(Terms) ->
475
{Keys, Modules} = lists:unzip(
476
rabbit_registry:lookup_all(Validator)),
@@ -481,8 +484,9 @@ validation(_Name, Terms, Validator) when is_list(Terms) ->
481
484
end;
482
485
false -> {error, "definition must be a dictionary: ~p", [Terms]}
483
486
-validation(_Name, Term, _Validator) ->
- {error, "parse error while reading policy: ~p", [Term]}.
487
+validation(Name, Term, Validator) ->
488
+ {error, "parse error while reading policy ~s: ~p. Validator: ~p.",
489
+ [Name, Term, Validator]}.
490
491
validation0(Validators, Terms) ->
492
case lists:foldl(
0 commit comments