From 38aba87e41cf0b95bb6ddd3c1a0e40f9e10785ef Mon Sep 17 00:00:00 2001 From: Dominik Charousset Date: Mon, 7 Dec 2020 16:43:42 +0100 Subject: [PATCH] Preserve string output of Broker errors --- src/broker/Manager.cc | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/broker/Manager.cc b/src/broker/Manager.cc index 8aec4f5db3..a486af5bdc 100644 --- a/src/broker/Manager.cc +++ b/src/broker/Manager.cc @@ -1499,7 +1499,20 @@ void Manager::ProcessError(broker::error err) ec = BifEnum::Broker::ErrorCode::UNSPECIFIED; } - msg = caf::to_string(err.context()); + // Note: we could also use to_string, but that change the log output + // and we would have to update all baselines relying on this format. + if ( auto mv = caf::make_const_typed_message_view(err.context()) ) + { + msg += '('; + msg += to_string(get<0>(mv).node); + msg += ", "; + msg += caf::deep_to_string(get<0>(mv).network); + msg += ", "; + msg += caf::deep_to_string(get<1>(mv)); + msg += ')'; + } + else + msg = caf::to_string(err.context()); } else {