Domain errors should include the domain in question

This commit is contained in:
Peter Eckersley
2016-01-29 13:41:24 -08:00
parent 9cce97ee66
commit d281162f17
+4 -3
View File
@@ -298,18 +298,19 @@ def check_domain_sanity(domain):
# Check if there's a wildcard domain
if domain.startswith("*."):
raise errors.ConfigurationError(
"Wildcard domains are not supported")
"Wildcard domains are not supported: {0}".format(domain))
# Punycode
if "xn--" in domain:
raise errors.ConfigurationError(
"Punycode domains are not presently supported")
"Punycode domains are not presently supported: {0}".format(domain))
# Unicode
try:
domain.encode('ascii')
except UnicodeDecodeError:
raise errors.ConfigurationError(
"Internationalized domain names are not presently supported")
"Internationalized domain names are not presently supported: {0}"
.format(domain))
# FQDN checks from
# http://www.mkyong.com/regular-expressions/domain-name-regular-expression-example/