mirror of
https://github.com/matrix-construct/construct
synced 2024-12-27 07:54:05 +01:00
ircd::net::dns::resolver: Improve error reporting on send_query().
This commit is contained in:
parent
3d3ec4ee1c
commit
d5bb55fbc3
1 changed files with 17 additions and 0 deletions
|
@ -459,6 +459,7 @@ ircd::net::dns::resolver::queue_query(tag &tag)
|
|||
void
|
||||
ircd::net::dns::resolver::send_query(const ip::udp::endpoint &ep,
|
||||
tag &tag)
|
||||
try
|
||||
{
|
||||
assert(ns.is_open());
|
||||
assert(ns.non_blocking());
|
||||
|
@ -474,6 +475,22 @@ ircd::net::dns::resolver::send_query(const ip::udp::endpoint &ep,
|
|||
tag.server = make_ipport(ep);
|
||||
tag.tries++;
|
||||
}
|
||||
catch(const std::exception &e)
|
||||
{
|
||||
thread_local char buf[128];
|
||||
log::error
|
||||
{
|
||||
log, "send tag:%u qtype:%u t:%u `%s' to %s :%s",
|
||||
tag.id,
|
||||
tag.opts.qtype,
|
||||
tag.tries,
|
||||
host(tag.hp),
|
||||
string(buf, make_ipport(ep)),
|
||||
e.what(),
|
||||
};
|
||||
|
||||
throw;
|
||||
}
|
||||
|
||||
//
|
||||
// recv
|
||||
|
|
Loading…
Reference in a new issue