More error-proofing

newworkflow_parseropti
Geoffrey Frogeye 2019-11-10 23:07:21 +01:00
parent 0801bd9e44
commit c409c2cf9b
1 changed files with 3 additions and 0 deletions

View File

@ -37,6 +37,9 @@ def is_subdomain_matching(subdomain: str) -> bool:
except dns.exception.Timeout: except dns.exception.Timeout:
print(f"Timeout for {subdomain}", file=sys.stderr) print(f"Timeout for {subdomain}", file=sys.stderr)
return False return False
except dns.name.EmptyLabel:
print(f"Empty label for {subdomain}", file=sys.stderr)
return False
canonical = query.canonical_name.to_text() canonical = query.canonical_name.to_text()
for regex in regexes.REGEXES: for regex in regexes.REGEXES:
if re.match(regex, canonical): if re.match(regex, canonical):