From 7596e8535879d63e2f090e28191dfa9bee887502 Mon Sep 17 00:00:00 2001 From: Tyler Neely Date: Wed, 2 Nov 2022 12:37:34 +0000 Subject: [PATCH] When message conversion fails to happen, demangle the concrete type name and error log a useful message --- src/io/message_conversion.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/io/message_conversion.hpp b/src/io/message_conversion.hpp index 11c045123..c4cce732b 100644 --- a/src/io/message_conversion.hpp +++ b/src/io/message_conversion.hpp @@ -11,6 +11,8 @@ #pragma once +#include + #include "io/transport.hpp" #include "utils/type_info_ref.hpp" @@ -90,6 +92,10 @@ struct OpaqueMessage { }; } + std::string demangled_name = "\"" + boost::core::demangle(message.type().name()) + "\""; + spdlog::error("failed to cast message of type {} to expected request type (probably in Receive argument types)", + demangled_name); + return std::nullopt; } };