@@ -304,6 +304,7 @@ is_compatible(Type, Durable, Exclusive, AutoDelete) ->
304304 {'new' | 'existing' | 'owner_died' , amqqueue :amqqueue ()} |
305305 {'absent' , amqqueue :amqqueue (), rabbit_amqqueue :absent_reason ()} |
306306 {protocol_error , Type :: atom (), Reason :: string (), Args :: term ()} |
307+ {'error' , Type :: atom (), Reason :: string (), Args :: term ()} |
307308 {'error' , Err :: term () }.
308309declare (Q0 , Node ) ->
309310 Q = rabbit_queue_decorator :set (rabbit_policy :set (Q0 )),
@@ -774,7 +775,7 @@ known_queue_type_names() ->
774775
775776-spec check_queue_limits (amqqueue :amqqueue ()) ->
776777 ok |
777- {protocol_error , Type :: atom () , Reason :: string (), Args :: term ()}.
778+ {error , queue_limit_exceeded , Reason :: string (), Args :: term ()}.
778779check_queue_limits (Q ) ->
779780 maybe
780781 ok ?= check_vhost_queue_limit (Q ),
@@ -788,10 +789,9 @@ check_vhost_queue_limit(Q) ->
788789 false ->
789790 ok ;
790791 {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 ])
795795 end .
796796
797797check_cluster_queue_limit (Q ) ->
@@ -802,11 +802,13 @@ check_cluster_queue_limit(Q) ->
802802 Limit ->
803803 case rabbit_db_queue :count () >= Limit of
804804 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 ]);
809808 false ->
810809 ok
811810 end
812811 end .
812+
813+ queue_limit_error (Reason , ReasonArgs ) ->
814+ {error , queue_limit_exceeded , Reason , ReasonArgs }.
0 commit comments