catch NoNameservers exception and show error msg on UI
This commit is contained in:
parent
32289ebb18
commit
16416cb2af
@ -36,6 +36,7 @@ from django.utils.timezone import now
|
|||||||
|
|
||||||
|
|
||||||
Timeout = dns.resolver.Timeout
|
Timeout = dns.resolver.Timeout
|
||||||
|
NoNameservers = dns.resolver.NoNameservers
|
||||||
|
|
||||||
|
|
||||||
class SameIpError(ValueError):
|
class SameIpError(ValueError):
|
||||||
|
@ -199,6 +199,8 @@ class OverviewView(CreateView):
|
|||||||
success, level, msg = False, messages.ERROR, 'Timeout - communicating to name server failed.'
|
success, level, msg = False, messages.ERROR, 'Timeout - communicating to name server failed.'
|
||||||
except dnstools.NameServerNotAvailable:
|
except dnstools.NameServerNotAvailable:
|
||||||
success, level, msg = False, messages.ERROR, 'Name server unavailable.'
|
success, level, msg = False, messages.ERROR, 'Name server unavailable.'
|
||||||
|
except dnstools.NoNameservers:
|
||||||
|
success, level, msg = False, messages.ERROR, 'Resolving failed: No name servers.'
|
||||||
except dnstools.DnsUpdateError as e:
|
except dnstools.DnsUpdateError as e:
|
||||||
success, level, msg = False, messages.ERROR, 'DNS update error [%s].' % str(e)
|
success, level, msg = False, messages.ERROR, 'DNS update error [%s].' % str(e)
|
||||||
except Domain.DoesNotExist:
|
except Domain.DoesNotExist:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user