统一异常处理

This commit is contained in:
shmilylty
2019-12-10 12:12:44 +08:00
parent 0cafe696a6
commit f5d02d74ef
11 changed files with 35 additions and 35 deletions
+2 -2
View File
@@ -34,8 +34,8 @@ def get_cname(subdomain):
resolver = resolve.dns_resolver()
try:
answers = resolver.query(subdomain, 'CNAME')
except Exception as exception:
logger.log('TRACE', exception.args)
except Exception as e:
logger.log('TRACE', e.args)
return None
for answer in answers:
return answer.to_text() # 一个子域只有一个CNAME记录