@@ -126,6 +126,7 @@ handle_http_req(HttpMethod = <<"PUT">>,
126126 ok = prohibit_reserved_amq (QName ),
127127 PermCache1 = check_resource_access (QName , configure , User , PermCache0 ),
128128 rabbit_core_metrics :queue_declared (QName ),
129+
129130 {Q1 , NumMsgs , NumConsumers , StatusCode , PermCache } =
130131 case rabbit_amqqueue :with (
131132 QName ,
@@ -146,36 +147,34 @@ handle_http_req(HttpMethod = <<"PUT">>,
146147 Result ;
147148 {error , not_found } ->
148149 PermCache2 = check_dead_letter_exchange (QName , QArgs , User , PermCache1 ),
149- try case rabbit_amqqueue :declare (
150- QName , Durable , AutoDelete , QArgs , Owner , Username ) of
151- {new , Q } ->
150+ try rabbit_amqqueue :declare (
151+ QName , Durable , AutoDelete , QArgs , Owner , Username ) of
152+ {new , Q } ->
152153 rabbit_core_metrics :queue_created (QName ),
153154 {Q , 0 , 0 , <<" 201" >>, PermCache2 };
154- {owner_died , Q } ->
155+ {owner_died , Q } ->
155156 % % Presumably our own days are numbered since the
156157 % % connection has died. Pretend the queue exists though,
157158 % % just so nothing fails.
158159 {Q , 0 , 0 , <<" 201" >>, PermCache2 };
159- {absent , Q , Reason } ->
160+ {absent , Q , Reason } ->
160161 absent (Q , Reason );
161- {existing , _Q } ->
162+ {existing , _Q } ->
162163 % % Must have been created in the meantime. Loop around again.
163164 handle_http_req (HttpMethod , PathSegments , Query , ReqPayload ,
164- Vhost , User , ConnPid , {PermCache2 , TopicPermCache });
165- {error , queue_limit_exceeded , Reason , ReasonArgs } ->
165+ Vhost , User , ConnPid , {PermCache2 , TopicPermCache });
166+ {error , queue_limit_exceeded , Reason , ReasonArgs } ->
166167 throw (<<" 403" >>,
167- Reason ,
168- ReasonArgs );
169- {protocol_error , _ErrorType , Reason , ReasonArgs } ->
168+ Reason ,
169+ ReasonArgs );
170+ {protocol_error , _ErrorType , Reason , ReasonArgs } ->
170171 throw (<<" 400" >>, Reason , ReasonArgs )
171- end
172172 catch exit :# amqp_error {name = precondition_failed ,
173- explanation = Expl } ->
174- throw (<<" 409" >>, Expl , []);
175- exit :# amqp_error {explanation = Expl } ->
176- throw (<<" 400" >>, Expl , [])
173+ explanation = Expl } ->
174+ throw (<<" 409" >>, Expl , []);
175+ exit :# amqp_error {explanation = Expl } ->
176+ throw (<<" 400" >>, Expl , [])
177177 end ;
178-
179178 {error , {absent , Q , Reason }} ->
180179 absent (Q , Reason )
181180 end ,
0 commit comments