fix crash on ShortHeader and other DNSException subclasses, fixes #247
This commit is contained in:
parent
60438d84fb
commit
118d0d51fd
@ -64,6 +64,7 @@ class FQDN(namedtuple('FQDN', ['host', 'domain'])):
|
||||
|
||||
Timeout = dns.resolver.Timeout
|
||||
NoNameservers = dns.resolver.NoNameservers
|
||||
DNSException = dns.exception.DNSException
|
||||
|
||||
|
||||
class SameIpError(ValueError):
|
||||
|
@ -238,6 +238,8 @@ class AddHostView(CreateView):
|
||||
success, level, msg = False, messages.ERROR, 'Base domain does not exist.'
|
||||
except dnstools.SameIpError:
|
||||
success, level, msg = False, messages.ERROR, 'Host already exists in DNS.'
|
||||
except dnstools.DNSException as e:
|
||||
success, level, msg = False, messages.ERROR, 'DNSException [%s]' % str(e)
|
||||
except socket.error as err:
|
||||
success, level, msg = False, messages.ERROR, 'Communication to name server failed [%s]' % str(err)
|
||||
else:
|
||||
|
Loading…
x
Reference in New Issue
Block a user