When message conversion fails to happen, demangle the concrete type name and error log a useful message

This commit is contained in:
Tyler Neely 2022-11-02 12:37:34 +00:00
parent 68654b5a19
commit 7596e85358

View File

@ -11,6 +11,8 @@
#pragma once
#include <boost/core/demangle.hpp>
#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;
}
};