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:
parent
d9a4f06bf6
commit
7c9c0ffa38
1 changed files with 21 additions and 0 deletions
21
ircd/mods.cc
21
ircd/mods.cc
|
@ -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());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue