mirror of
https://github.com/matrix-construct/construct
synced 2024-12-26 15:33:54 +01:00
ircd::server: Ensure throwing in case error is set w/o exception; minor cleanup.
This commit is contained in:
parent
4b61ea5387
commit
7d60b6fddc
1 changed files with 12 additions and 6 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue