Skip to content

Commit 4735e01

Browse files
Merge pull request #11215 from rabbitmq/mergify/bp/v3.13.x/pr-11214
Declaring an exchange with an invalid type is a precondition failure (backport #11214)
2 parents dc7c51a + 312b3e0 commit 4735e01

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

deps/rabbit/src/rabbit_exchange.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,11 @@ check_type(TypeBin) ->
142142
case rabbit_registry:binary_to_type(rabbit_data_coercion:to_binary(TypeBin)) of
143143
{error, not_found} ->
144144
rabbit_misc:protocol_error(
145-
command_invalid, "unknown exchange type '~ts'", [TypeBin]);
145+
precondition_failed, "unknown exchange type '~ts'", [TypeBin]);
146146
T ->
147147
case rabbit_registry:lookup_module(exchange, T) of
148148
{error, not_found} -> rabbit_misc:protocol_error(
149-
command_invalid,
149+
precondition_failed,
150150
"invalid exchange type '~ts'", [T]);
151151
{ok, _Module} -> T
152152
end

0 commit comments

Comments
 (0)