catch NoNameservers exception and show error msg on UI

This commit is contained in:
Thomas Waldmann 2014-05-29 17:27:11 +02:00
parent 32289ebb18
commit 16416cb2af
2 changed files with 3 additions and 0 deletions

View File

@ -36,6 +36,7 @@ from django.utils.timezone import now
Timeout = dns.resolver.Timeout
NoNameservers = dns.resolver.NoNameservers
class SameIpError(ValueError):

View File

@ -199,6 +199,8 @@ class OverviewView(CreateView):
success, level, msg = False, messages.ERROR, 'Timeout - communicating to name server failed.'
except dnstools.NameServerNotAvailable:
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:
success, level, msg = False, messages.ERROR, 'DNS update error [%s].' % str(e)
except Domain.DoesNotExist: