0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-26 00:32:35 +01:00

ircd::mods: Rewrite undefined symbol exception using demangling.

This commit is contained in:
Jason Volk 2017-08-28 17:05:31 -07:00
parent d9a4f06bf6
commit 7c9c0ffa38

View file

@ -700,6 +700,27 @@ try
} }
catch(const boost::system::system_error &e) catch(const boost::system::system_error &e)
{ {
switch(e.code().value())
{
case boost::system::errc::bad_file_descriptor:
{
const string_view what(e.what());
const auto pos(what.find("undefined symbol: "));
if(pos == std::string_view::npos)
break;
const string_view msg(what.substr(pos));
const std::string mangled(between(msg, ": ", ")"));
const std::string demangled(demangle(mangled));
throw error("undefined symbol: '%s' (%s)",
demangled,
mangled);
}
default:
break;
}
throw error("%s", e.what()); throw error("%s", e.what());
} }