Skip to content

Commit b265f62

Browse files
Merge pull request #11216 from rabbitmq/mergify/bp/v3.12.x/pr-11215
Declaring an exchange with an invalid type is a precondition failure (backport #11214) (backport #11215)
2 parents f035490 + 258f87b commit b265f62

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
@@ -136,11 +136,11 @@ check_type(TypeBin) ->
136136
case rabbit_registry:binary_to_type(rabbit_data_coercion:to_binary(TypeBin)) of
137137
{error, not_found} ->
138138
rabbit_misc:protocol_error(
139-
command_invalid, "unknown exchange type '~ts'", [TypeBin]);
139+
precondition_failed, "unknown exchange type '~ts'", [TypeBin]);
140140
T ->
141141
case rabbit_registry:lookup_module(exchange, T) of
142142
{error, not_found} -> rabbit_misc:protocol_error(
143-
command_invalid,
143+
precondition_failed,
144144
"invalid exchange type '~ts'", [T]);
145145
{ok, _Module} -> T
146146
end

0 commit comments

Comments
 (0)