Skip to content

Commit e8fbb09

Browse files
committed
Return "precondition failed" on exchange deletion if appropriate
If unused flag is set. This keeps the original behavior.
1 parent 297d9ed commit e8fbb09

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

deps/rabbit/src/rabbit_exchange.erl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,13 @@ delete(XName, IfUnused, Username) ->
428428
?EXCHANGE_DELETE_IN_PROGRESS_COMPONENT,
429429
XName#resource.name, true, Username),
430430
Deletions = process_deletions(rabbit_db_exchange:delete(XName, IfUnused)),
431-
rabbit_binding:notify_deletions(Deletions, Username)
431+
case Deletions of
432+
{error, _} ->
433+
Deletions;
434+
_ ->
435+
rabbit_binding:notify_deletions(Deletions, Username),
436+
ok
437+
end
432438
after
433439
rabbit_runtime_parameters:clear(XName#resource.virtual_host,
434440
?EXCHANGE_DELETE_IN_PROGRESS_COMPONENT,

0 commit comments

Comments
 (0)