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

ircd::server: Ensure throwing in case error is set w/o exception; minor cleanup.

This commit is contained in:
Jason Volk 2022-07-04 15:57:23 -07:00
parent 4b61ea5387
commit 7d60b6fddc

View file

@ -1130,15 +1130,21 @@ ircd::server::peer::link_add(const size_t &num)
{
assert(!finished());
if(e)
{
if(e && e->eptr)
std::rethrow_exception(e->eptr);
__builtin_unreachable();
}
assert(!e);
if(unlikely(e))
throw unavailable
{
"Cannot add link to peer %s."
};
assert(!op_fini);
links.emplace_back(*this);
auto &link{links.back()};
auto &link
{
links.emplace_back(*this)
};
if(remote)
link.open(open_opts);