Skip to content

Commit 312b3e0

Browse files
carlhoerbergmergify[bot]
authored andcommitted
Declaring an exchange with an invalid type is a precondition failure
Not a invalid command that closes the whole connection. (cherry picked from commit b6aacb7)
1 parent dc7c51a commit 312b3e0

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)