Skip to content

Commit 258f87b

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) (cherry picked from commit 312b3e0)
1 parent f035490 commit 258f87b

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)