Catch more types of query errors
This commit is contained in:
parent
2c0e61b831
commit
9f0ac830f2
1 changed files with 2 additions and 1 deletions
|
@ -10,6 +10,7 @@ import dns.asyncquery
|
|||
import dns.nameserver
|
||||
import dns.resolver
|
||||
import dns.message
|
||||
from dns.quic._common import UnexpectedEOF
|
||||
from urllib.parse import urlparse
|
||||
|
||||
|
||||
|
@ -116,7 +117,7 @@ class DNSCommand(niobot.Module):
|
|||
end_ts = time.perf_counter()
|
||||
if isinstance(response, dns.message.Message):
|
||||
response = (response, False)
|
||||
except dns.exception.DNSException as err:
|
||||
except (dns.exception.DNSException, UnexpectedEOF, httpx.HTTPError, ValueError) as err:
|
||||
return await m.edit(
|
||||
"There was an error while querying the DNS server:\n```\n%s\n```" % err
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue