0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-27 07:54:05 +01:00

ircd::net: Fix error fmtstr; use static exception instance for copy.

This commit is contained in:
Jason Volk 2018-05-09 21:12:01 -07:00
parent 6feaa95d4b
commit 3f296f2108

View file

@ -1847,9 +1847,7 @@ noexcept try
// All other errors are unexpected, logged and ignored here.
default: throw assertive
{
"unexpected: %s\n",
(const void *)this,
string(ec)
"socket(%p): unexpected: %s\n", (const void *)this, string(ec)
};
}
else ec = { operation_canceled, system_category() };
@ -2396,7 +2394,14 @@ ircd::net::dns::operator()(const hostport &hp,
return callback(std::move(eptr), hp, {});
if(!ip)
return callback(std::make_exception_ptr(net::not_found{"Host has no A record"}), hp, {});
{
static const net::not_found no_record
{
"Host has no A record"
};
return callback(std::make_exception_ptr(no_record), hp, {});
}
const ipport ipport{ip, port(hp)};
callback(std::move(eptr), hp, ipport);