Skip to content

Commit

Permalink
Merge pull request #11216 from rabbitmq/mergify/bp/v3.12.x/pr-11215
Browse files Browse the repository at this point in the history
Declaring an exchange with an invalid type is a precondition failure (backport #11214) (backport #11215)
  • Loading branch information
michaelklishin authored May 12, 2024
2 parents f035490 + 258f87b commit b265f62
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions deps/rabbit/src/rabbit_exchange.erl
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,11 @@ check_type(TypeBin) ->
case rabbit_registry:binary_to_type(rabbit_data_coercion:to_binary(TypeBin)) of
{error, not_found} ->
rabbit_misc:protocol_error(
command_invalid, "unknown exchange type '~ts'", [TypeBin]);
precondition_failed, "unknown exchange type '~ts'", [TypeBin]);
T ->
case rabbit_registry:lookup_module(exchange, T) of
{error, not_found} -> rabbit_misc:protocol_error(
command_invalid,
precondition_failed,
"invalid exchange type '~ts'", [T]);
{ok, _Module} -> T
end
Expand Down

0 comments on commit b265f62

Please sign in to comment.