@@ -304,6 +304,7 @@ is_compatible(Type, Durable, Exclusive, AutoDelete) ->
304
304
{'new' | 'existing' | 'owner_died' , amqqueue :amqqueue ()} |
305
305
{'absent' , amqqueue :amqqueue (), rabbit_amqqueue :absent_reason ()} |
306
306
{protocol_error , Type :: atom (), Reason :: string (), Args :: term ()} |
307
+ {'error' , Type :: atom (), Reason :: string (), Args :: term ()} |
307
308
{'error' , Err :: term () }.
308
309
declare (Q0 , Node ) ->
309
310
Q = rabbit_queue_decorator :set (rabbit_policy :set (Q0 )),
@@ -774,7 +775,7 @@ known_queue_type_names() ->
774
775
775
776
-spec check_queue_limits (amqqueue :amqqueue ()) ->
776
777
ok |
777
- {protocol_error , Type :: atom () , Reason :: string (), Args :: term ()}.
778
+ {error , queue_limit_exceeded , Reason :: string (), Args :: term ()}.
778
779
check_queue_limits (Q ) ->
779
780
maybe
780
781
ok ?= check_vhost_queue_limit (Q ),
@@ -788,10 +789,9 @@ check_vhost_queue_limit(Q) ->
788
789
false ->
789
790
ok ;
790
791
{true , Limit } ->
791
- {protocol_error , precondition_failed ,
792
- " cannot declare queue '~ts ': "
793
- " queue limit in vhost '~ts ' (~tp ) is reached" ,
794
- [QueueName , VHost , Limit ]}
792
+ queue_limit_error (" cannot declare queue '~ts ': "
793
+ " queue limit in vhost '~ts ' (~tp ) is reached" ,
794
+ [QueueName , VHost , Limit ])
795
795
end .
796
796
797
797
check_cluster_queue_limit (Q ) ->
@@ -802,11 +802,13 @@ check_cluster_queue_limit(Q) ->
802
802
Limit ->
803
803
case rabbit_db_queue :count () >= Limit of
804
804
true ->
805
- {protocol_error , precondition_failed ,
806
- " cannot declare queue '~ts ': "
807
- " queue limit in cluster (~tp ) is reached" ,
808
- [QueueName , Limit ]};
805
+ queue_limit_error (" cannot declare queue '~ts ': "
806
+ " queue limit in cluster (~tp ) is reached" ,
807
+ [QueueName , Limit ]);
809
808
false ->
810
809
ok
811
810
end
812
811
end .
812
+
813
+ queue_limit_error (Reason , ReasonArgs ) ->
814
+ {error , queue_limit_exceeded , Reason , ReasonArgs }.
0 commit comments