Skip to content

Commit 0a144e7

Browse files
committed
Prevent formatter crash in mgmt_util
`rabbit_mgmt_util:direct_request/6` is always called with an `ErrorMsg` which expects one format argument as a string. Convert the arbitrary reason term into a string to avoid a crash like the below: ``` warning: FORMATTER CRASH: {"Delete exchange error: ~ts",[{'EXIT',{{badmatch,{error,... ```
1 parent 5eb4eef commit 0a144e7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

deps/rabbitmq_management/src/rabbit_mgmt_util.erl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,8 @@ direct_request(MethodName, Transformers, Extra, ErrorMsg, ReqData,
809809
rabbit_log:warning(ErrorMsg, [Explanation]),
810810
bad_request(list_to_binary(Explanation), ReqData1, Context);
811811
{badrpc, Reason} ->
812-
rabbit_log:warning(ErrorMsg, [Reason]),
812+
Msg = io_lib:format("~tp", [Reason]),
813+
rabbit_log:warning(ErrorMsg, [Msg]),
813814
bad_request(
814815
list_to_binary(
815816
io_lib:format("Request to node ~ts failed with ~tp",

0 commit comments

Comments
 (0)