mirror of
https://github.com/matrix-construct/construct
synced 2024-11-25 16:22:35 +01:00
ircd::net: Fix error fmtstr; use static exception instance for copy.
This commit is contained in:
parent
6feaa95d4b
commit
3f296f2108
1 changed files with 9 additions and 4 deletions
13
ircd/net.cc
13
ircd/net.cc
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue