Skip to content

Commit 2259f84

Browse files
committed
Use rabbit_misc:rs/1 on exchange resource records
This fixes a potential crash in `rabbit_amqp_amanegment` where we tried to format the exchange resource as a string (`~ts`). The change in `rabbit_channel` is cosmetic.
1 parent fb3154b commit 2259f84

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

deps/rabbit/src/rabbit_amqp_management.erl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,9 @@ handle_http_req(<<"PUT">>,
218218
{error, timeout} ->
219219
throw(
220220
<<"503">>,
221-
"Could not create exchange '~ts' in vhost '~ts' "
222-
"because the operation timed out",
223-
[XName, Vhost])
221+
"Could not create ~ts because the operation "
222+
"timed out",
223+
[rabbit_misc:rs(XName)])
224224
end
225225
end,
226226
try rabbit_exchange:assert_equivalence(
@@ -300,8 +300,8 @@ handle_http_req(<<"DELETE">>,
300300
{error, timeout} ->
301301
throw(
302302
<<"503">>,
303-
"failed to delete exchange '~ts' due to a timeout",
304-
[XNameBin])
303+
"failed to delete ~ts due to a timeout",
304+
[rabbit_misc:rs(XName)])
305305
end;
306306

307307
handle_http_req(<<"POST">>,

deps/rabbit/src/rabbit_channel.erl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2581,9 +2581,9 @@ handle_method(#'exchange.declare'{exchange = XNameBin,
25812581
{error, timeout} ->
25822582
rabbit_misc:protocol_error(
25832583
internal_error,
2584-
"failed to declare exchange '~ts' in vhost '~ts' "
2585-
"because the operation timed out",
2586-
[XNameBinStripped, VHostPath])
2584+
"failed to declare ~ts because the operation "
2585+
"timed out",
2586+
[rabbit_misc:rs(ExchangeName)])
25872587
end
25882588
end,
25892589
ok = rabbit_exchange:assert_equivalence(X, CheckedType, Durable,

0 commit comments

Comments
 (0)