浏览代码

Fix dns query could throw different kinds of exceptions

Son NK 5 年之前
父节点
当前提交
be1b689463
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      app/dns_utils.py

+ 1 - 1
app/dns_utils.py

@@ -7,7 +7,7 @@ def get_mx_domains(hostname) -> [(int, str)]:
     """
     try:
         answers = dns.resolver.query(hostname, "MX")
-    except dns.resolver.NoAnswer:
+    except Exception:
         return []
 
     ret = []